-
Notifications
You must be signed in to change notification settings - Fork 12
Use standard linters #168
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
Use standard linters #168
Changes from all commits
Commits
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 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,26 @@ | ||
| run: | ||
| skip-dirs: | ||
| - .*/mocks | ||
|
|
||
| issues: | ||
| # https://github.com/golangci/golangci-lint/issues/2439 | ||
| exclude-use-default: false | ||
|
|
||
| linters: | ||
| enable: | ||
| - errcheck | ||
| - gosimple | ||
| - govet | ||
| - ineffassign | ||
| - staticcheck | ||
| - typecheck | ||
| - unused | ||
| - revive | ||
|
|
||
| linters-settings: | ||
| revive: | ||
| severity: error | ||
| rules: | ||
| - name: exported | ||
| arguments: | ||
| - checkPrivateReceivers | ||
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,11 +1,13 @@ | ||
| format_version: "11" | ||
| default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git | ||
|
|
||
|
|
||
| workflows: | ||
| test: | ||
| steps: | ||
| - go-list: | ||
| - golint: | ||
| - errcheck: | ||
| - go-test: | ||
| - git::https://github.com/bitrise-steplib/steps-check.git: | ||
| title: Lint | ||
| inputs: | ||
| - workflow: lint | ||
| - skip_step_yml_validation: "yes" | ||
| - go-list: { } | ||
| - go-test: { } |
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.
Are these repo specific settings needed because the global one was producing issues?
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.
@lpusok had the idea to keep enforcing comments for exported types and functions. This is disabled by default, this is the part that enables it explicitly. I think this lint rule only makes sense in library repos, I wouldn't enforce it in step repos.
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.
And we need the
run,issues,linterssection too just to be able to uselinters-settings?By the way I have a beef with this rule because at the moment I do not think it is useful. Most of our stuff simply receive this to please the linting gods (you are the exception because I remember in previous cache PRs you left some actual description for the exported functions):
I am happy to have it as it is too but if it were to me then I would simply remove this rule. 😄
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.
The
runandissuessections are needed to make it work in our repo, thelinterssection is not strictly needed, but I thought it's a good idea to explicitly define the enabled linters that are enabled by default anyway. But I'm happy to remove it if you don't find it useful!I too find it sometimes annoying, but it also made me add meaningful comments on a few occasions when I forgot to do it on my own 😁 Let's go with it for now and I'll raise this on the next eng sync to discuss.