Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix go release + align with updates on azure-ad repo #36

Merged
merged 1 commit into from
Jul 23, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Raito CLI - Azure Plugin - Build
on:
push:
branches:
- 'main'
- "main"
pull_request:

env:
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Raito CLI - Azure Plugin - Release
on:
push:
tags:
- 'v*'
- "v*"

permissions:
contents: write
Expand All @@ -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"
Expand All @@ -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}}
37 changes: 29 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ linters-settings:
- paramTypeCombine

govet:
check-shadowing: true
enable:
- shadow

revive:
rules:
Expand All @@ -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:
Expand All @@ -72,6 +93,7 @@ linters:
- dupword
- durationcheck
- errcheck
- errorlint
- exportloopref
- exhaustive
- forbidigo
Expand All @@ -86,6 +108,7 @@ linters:
- govet
- ineffassign
- misspell
- nilerr
- nolintlint
- nakedret
- prealloc
Expand All @@ -100,7 +123,6 @@ linters:
- unparam
- unused
- whitespace
# - wrapcheck # 3th party errors should be wrapped to not lose context
- wsl

run:
Expand All @@ -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
uniq-by-line: false
15 changes: 8 additions & 7 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Make sure to check the documentation at https://goreleaser.com
version: 2

project_name: cli-plugin-azure
before:
hooks:
Expand All @@ -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
prerelease: auto
Loading