diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2ba6c14..135f9ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Raito CLI - Azure Plugin - Build on: push: branches: - - 'main' + - "main" pull_request: env: @@ -18,7 +18,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: "1.22" cache: true - name: Configure git for private modules @@ -33,7 +33,7 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v6 with: - version: v1.56.1 + version: v1.59.1 - name: Test run: make test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a93b006..5036bef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Raito CLI - Azure Plugin - Release on: push: tags: - - 'v*' + - "v*" permissions: contents: write @@ -23,7 +23,9 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.22 + go-version-file: go.mod + check-latest: true + cache: true - name: Configure git for private modules run: git config --global url."https://${{secrets.CI_SECRETS_TOKEN_USER}}:${{secrets.CI_SECRETS_TOKEN}}@github.com".insteadOf "https://github.com" @@ -33,7 +35,7 @@ jobs: with: distribution: goreleaser version: latest - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.CI_SECRETS_TOKEN }} GORELEASER_CURRENT_TAG: ${{github.ref_name}} diff --git a/.golangci.yml b/.golangci.yml index 6e71f41..b6a3419 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -24,7 +24,8 @@ linters-settings: - paramTypeCombine govet: - check-shadowing: true + enable: + - shadow revive: rules: @@ -36,30 +37,50 @@ linters-settings: allow-cuddle-declarations: true # should be false nolintlint: - allow-no-explanation: [ ] + allow-no-explanation: [] require-explanation: false require-specific: false gosec: excludes: - G404 # To be checked: Insecure random number source (rand) - - G602 stylecheck: - checks: [ "all", "-ST1003"] # ST1003: No underscores in package names should be fixed and removed? + checks: ["all", "-ST1003"] # ST1003: No underscores in package names should be fixed and removed? predeclared: ignore: "error" gomnd: ignored-functions: - - 'math.*' # Magic number generation, should be fixed and removed? + - "math.*" # Magic number generation, should be fixed and removed? cyclop: max-complexity: 20 skip-tests: true package-average: 0.0 + errorlint: + errorf: true + errorf-multi: true + asserts: true + comparison: true + + exhaustive: + default-signifies-exhaustive: true + + wrapcheck: + ignoreSigs: + - .Errorf( + - errors.New( + - errors.Unwrap( + - .Wrap( + - .Wrapf( + - .WithMessage( + - .WithMessagef( + - .WithStack( + - go-multierror.Append( + linters: disable-all: true enable: @@ -72,6 +93,7 @@ linters: - dupword - durationcheck - errcheck + - errorlint - exportloopref - exhaustive - forbidigo @@ -86,6 +108,7 @@ linters: - govet - ineffassign - misspell + - nilerr - nolintlint - nakedret - prealloc @@ -100,7 +123,6 @@ linters: - unparam - unused - whitespace - # - wrapcheck # 3th party errors should be wrapped to not lose context - wsl run: @@ -110,7 +132,6 @@ run: output: path-prefix: "" sort-results: true - format: tab print-issued-lines: false print-linter-name: true - uniq-by-line: false \ No newline at end of file + uniq-by-line: false diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5c050bc..e0240c2 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -1,4 +1,6 @@ # Make sure to check the documentation at https://goreleaser.com +version: 2 + project_name: cli-plugin-azure before: hooks: @@ -12,16 +14,15 @@ builds: ldflags: - -X main.version={{.Version}} checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" changelog: sort: asc filters: exclude: - - '^docs:' - - '^test:' + - "^docs:" + - "^test:" archives: - - - format: 'tar.gz' - name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}_{{ .Arch }}' + - format: "tar.gz" + name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}_{{ .Arch }}" release: - prerelease: auto \ No newline at end of file + prerelease: auto