Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

cleanups to "go generate" #166

Merged
2 commits merged into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/govulncheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Go generate
run: go generate ./...
- name: Run
run: govulncheck ./...
run: govulncheck ./...
2 changes: 2 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Go generate
run: go generate ./...
- name: Run Go linter
uses: golangci/golangci-lint-action@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/staticcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ jobs:
${{ runner.os }}-go-
- name: Install
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Go generate
run: go generate ./...
- name: Run
run: staticcheck ./...
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Go generate
run: go generate ./...

- name: Run test
run: go test -race -v -coverprofile=coverage.out ./...

Expand Down
11 changes: 11 additions & 0 deletions pkg/lang/javascript/aws_runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
/node_modules/
dispatcher_fargate.js.tmpl
dispatcher_lambda.js.tmpl
emitter.js.tmpl
fs.js.tmpl
keyvalue.js.tmpl
orm.js.tmpl
proxy_eks.js.tmpl
proxy_fargate.js.tmpl
redis_cluster.js.tmpl
redis_node.js.tmpl
secret.js.tmpl
Comment on lines 1 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ignore checking these in? we dont have .js files for all of them so we need some of these checked in

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which ones don't we have .ts files for? I actually even create the changes to this file manually; they're all from the bash script's changes to add the generated files to this ignore.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i guess this list doesnt include the ones which we dont have ts files for

15 changes: 10 additions & 5 deletions pkg/lang/javascript/aws_runtime/compile_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ if [ 'Darwin' = "$(uname -s)" ]; then
fi

npm install

echo "$*" | jq -R '. | split(" ") | map("_" + . + ".ts") | {extends: "./tsconfig.json", include: .}' > tmp_tsconfig.json
npx tsc --project tmp_tsconfig.json
rm tmp_tsconfig.json

for var in "$@"
do
echo '{"extends": "./tsconfig.json", "include": ["'_${var}.ts'"]}' > tmp_tsconfig.json
tsc --project tmp_tsconfig.json
rm tmp_tsconfig.json

mv _${var}.js ${var}.js.tmpl
ksed 's://TMPL ::g' ${var}.js.tmpl
ksed 's://TMPL ::g' ${var}.js.tmpl
echo "generated ${var}.js.tmpl"
echo ${var}.js.tmpl >> .gitignore
done

sort -u .gitignore > gitignore-tmp
mv gitignore-tmp .gitignore
Comment on lines +22 to +23
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever, I like this a lot.

40 changes: 0 additions & 40 deletions pkg/lang/javascript/aws_runtime/dispatcher_fargate.js.tmpl

This file was deleted.

124 changes: 0 additions & 124 deletions pkg/lang/javascript/aws_runtime/dispatcher_lambda.js.tmpl

This file was deleted.

119 changes: 0 additions & 119 deletions pkg/lang/javascript/aws_runtime/emitter.js.tmpl

This file was deleted.

Loading