From 5a8a7047fd0af01165d28fa529212e73594cfacc Mon Sep 17 00:00:00 2001 From: AislingHPE Date: Wed, 21 Aug 2024 16:39:23 +0100 Subject: [PATCH] Update to go 1.22 Go 1.22 has been out for a while now, so I'm updating the version here just to be more up to date. Also add a README which is just a TODO list right now. --- .github/workflows/CI.yml | 6 +++--- .golangci.yaml | 13 ++++++------- README | 7 +++++++ cmd/cmd.go | 6 ------ go.mod | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 README diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 6df494a..c643ffd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,12 +14,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.22' - name: GolangCI Lint uses: golangci/golangci-lint-action@v3 with: # TODO: Update this version. - version: v1.56.2 + version: v1.60.2 args: --out-format=colored-line-number test: name: Go Test @@ -28,6 +28,6 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version: '1.22' - name: Go Test run: go test -v ./... diff --git a/.golangci.yaml b/.golangci.yaml index 9d9b85b..549e431 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -44,7 +44,6 @@ linters: - errname - errorlint - exhaustive - - exportloopref - funlen - gocognit - gocritic @@ -93,11 +92,11 @@ linters: issues: include: - # Match function comment to function name - - EXC0012 - - EXC0013 - - EXC0014 - - EXC0015 + # Match function comment to function name + - EXC0012 + - EXC0013 + - EXC0014 + - EXC0015 exclude: # We want to allow exporting const/var/type without comments @@ -111,7 +110,7 @@ issues: exclude-rules: # ignore function length for tests as look up tables typically exceed. - linters: - - funlen + - funlen path: _test\.go max-same-issues: 0 diff --git a/README b/README new file mode 100644 index 0000000..1deb521 --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +# TODO list + +- Add the command line +- Add README including usage instructions, and a description of how the project actually works +- Consider making a github action for this +- Add a make rule to make a binary +- Goreleaser? diff --git a/cmd/cmd.go b/cmd/cmd.go index a7f75b4..5dc0c39 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -19,12 +19,6 @@ import ( // - output: file, default is ./schema.json. Allow creation of directories. // - input: folder, default is . // - allow-empty: if no variables are found, print empty schema and exit with 0 -// error handling: print to stdout and exit with non-zero exit code. Do not print schema. - -// Also TODO: how do we handle errors for validation rules? If a validation rule fails to be translated, -// we need to alert the user somehow, and it would be nice to print the associated errors, but there might be 4 -// errors since we try 4 rules. We also can't halt the program, since it might be an expected error. Logging is also -// much more difficult if we need to print the schema itself to stdout in some cases. var ( disallowAdditionalProperties bool diff --git a/go.mod b/go.mod index 817da7e..e145ce8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/HewlettPackard/terraschema -go 1.21.6 +go 1.22.6 require ( github.com/google/go-cmp v0.6.0