-
Notifications
You must be signed in to change notification settings - Fork 126
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
ci: add golangci-lint workflow #448
Merged
philipp-hinteregger
merged 14 commits into
keptn:main
from
philipp-hinteregger:ci/391/introduce-go-linters
Nov 23, 2022
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d3cadec
ci: add golangci-lint workflow
philipp-hinteregger 6465ee8
fix linter errors
philipp-hinteregger e0f6e33
fix linter errors
philipp-hinteregger 63d2af1
fix linter errors
philipp-hinteregger cccd8a3
re-format using make fmt
philipp-hinteregger 2eae4e9
remove unused function
philipp-hinteregger 49ec5c0
re-format scheduler using make fmt
philipp-hinteregger 6041ae4
use specific output formats
philipp-hinteregger 6cf8d2b
fix config
philipp-hinteregger 70922bc
fix linter errors
philipp-hinteregger 772163a
use propper error handling
philipp-hinteregger 853dcdc
Update operator/controllers/common/metrics_test.go
philipp-hinteregger 71912ee
extract duplicated error message into const variable
philipp-hinteregger f4e0580
fix linter errors
philipp-hinteregger 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 contains 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,31 @@ | ||
name: golangci-lint | ||
on: pull_request | ||
env: | ||
GOLANGCI_LINT_VERSION: "v1.50.1" | ||
GO_VERSION: "1.19" | ||
jobs: | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- name: "keptn-lifecycle-operator" | ||
folder: "operator/" | ||
- name: "scheduler" | ||
folder: "scheduler/" | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
working-directory: ${{ matrix.config.folder }} | ||
version: ${{ env.GOLANGCI_LINT_VERSION }} | ||
args: --config ../.golangci.yml -v |
This file contains 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,12 @@ | ||
run: | ||
timeout: 5m | ||
go: '1.19' | ||
linters: | ||
enable: | ||
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification | ||
# - dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f()) | ||
# - containedctx # containedctx is a linter that detects struct contained context.Context field | ||
# - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. | ||
# - gci # Gci controls golang package import order and makes it always deterministic. | ||
# - nilnil # Checks that there is no simultaneous return of nil error and an invalid value. | ||
# - noctx # noctx finds sending http request without context.Context |
This file contains 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
32 changes: 17 additions & 15 deletions
32
operator/controllers/common/fake/activemetricsobject_mock.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
this name is maybe a bit misleading. what go module are we meaning here?