-
Notifications
You must be signed in to change notification settings - Fork 39
Migrate CI to GitHub Actions #82
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a9d5fa7
Switch CI to GitHub Actions
krvladislav 36a3500
Migrate golangci-lint config to v2
krvladislav 8f2541a
Fix gocritic warnings
krvladislav ca37ec7
Check consumption flag setup error
krvladislav 14f5f2e
Update x/tools to v0.26.0
krvladislav c684008
Defer gocyclo enablement
krvladislav b428559
Run golangci-lint in GitHub Actions
krvladislav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Go | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| checks: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
|
|
||
| - uses: actions/setup-go@v7 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Download dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Test | ||
| run: go test ./... | ||
|
|
||
| - name: Lint | ||
| uses: golangci/golangci-lint-action@v9.3.0 | ||
| with: | ||
| version: v2.13.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,47 @@ | ||
| linters-settings: | ||
| govet: | ||
| check-shadowing: true | ||
| golint: | ||
| min-confidence: 0 | ||
| maligned: | ||
| suggest-new: true | ||
| dupl: | ||
| threshold: 100 | ||
| goconst: | ||
| min-len: 2 | ||
| min-occurrences: 2 | ||
| misspell: | ||
| locale: US | ||
| lll: | ||
| line-length: 140 | ||
| gocritic: | ||
| enabled-tags: | ||
| - performance | ||
| - style | ||
| - experimental | ||
| disabled-checks: | ||
| - wrapperFunc | ||
| version: "2" | ||
|
|
||
| linters: | ||
| enable-all: true | ||
| disable: | ||
| - maligned | ||
| - prealloc | ||
| - gochecknoglobals | ||
|
|
||
| run: | ||
| skip-dirs: | ||
| - passes/bodyclose/testdata | ||
|
|
||
| issues: | ||
| exclude-rules: | ||
| - text: "weak cryptographic primitive" | ||
| linters: | ||
| default: standard | ||
| enable: | ||
| - dupl | ||
| - gocritic | ||
| # TODO: Enable gocyclo after refactoring isopen. | ||
| # - gocyclo | ||
| - gosec | ||
| - lll | ||
| - misspell | ||
| - nakedret | ||
| - unconvert | ||
| - unparam | ||
| settings: | ||
| dupl: | ||
| threshold: 100 | ||
| gocritic: | ||
| enabled-tags: | ||
| - performance | ||
| - style | ||
| - experimental | ||
| disabled-checks: | ||
| - wrapperFunc | ||
| govet: | ||
| enable: | ||
| - shadow | ||
| lll: | ||
| line-length: 140 | ||
| misspell: | ||
| locale: US | ||
| exclusions: | ||
| rules: | ||
| - text: weak cryptographic primitive | ||
| linters: | ||
| - gosec | ||
| paths: | ||
| - ^passes/bodyclose/testdata/ | ||
|
|
||
| service: | ||
| golangci-lint-version: 1.15.x # use the fixed version to not introduce new linters unexpectedly | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
| exclusions: | ||
| paths: | ||
| - ^passes/bodyclose/testdata/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,14 @@ | ||
| module github.com/timakin/bodyclose | ||
|
|
||
| go 1.22 | ||
| go 1.22.0 | ||
|
|
||
| require ( | ||
| github.com/gostaticanalysis/analysisutil v0.7.1 | ||
| golang.org/x/tools v0.14.0 | ||
| golang.org/x/tools v0.26.0 | ||
| ) | ||
|
|
||
| require ( | ||
| github.com/gostaticanalysis/comment v1.4.2 // indirect | ||
| golang.org/x/mod v0.21.0 // indirect | ||
| golang.org/x/sync v0.8.0 // indirect | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gocyclo is intentionally left disabled for now
Enabling it reports that isopen has a cyclomatic complexity of 49 with a limit of 30
The function has accumulated several SSA handling paths and would benefit from a focused refactoring
I can address it in a separate PR and enable gocyclo there
Alternatively the check can remain disabled