Repository navigation
chore: adopt shared lint hooks #212
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
Open
niko-kriznik-globtim
wants to merge
21
commits into
main
Choose a base branch
from
chore/adopt-shared-lint-hooks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e73754b
chore(lint): copy shared golangci config
niko-kriznik-globtim 0f5de4a
chore: adopt shared pre-commit hooks
niko-kriznik-globtim 9c16caf
ci: lint only new issues and fail closed on secret scans
niko-kriznik-globtim 3bcd091
chore: pick up shared lint hook fixes
niko-kriznik-globtim bee9190
fix(lint): make the shared golangci config load
niko-kriznik-globtim cb3818c
fix(ci): use a valid detect-secrets audit flag
niko-kriznik-globtim b5c8517
chore(lint): sync shared golangci config and ruleguard rules
niko-kriznik-globtim 94356d4
chore: pin shared hooks to ci-templates cdcceba over HTTPS
niko-kriznik-globtim bd9726e
fix(ci): make the detect-secrets check fail on new secrets
niko-kriznik-globtim 4958d4d
chore(secrets): refresh baseline for findings already on main
niko-kriznik-globtim e6b526c
ci: run golangci-lint v2.12.2 with lint-action v9
niko-kriznik-globtim d7ea444
build(lint): move to golangci-lint v2.14 and ci-templates 7850271
niko-kriznik-globtim d2c7f27
fix(ci): fail the secrets check only on new secrets
niko-kriznik-globtim cc7cf26
ci: lint new issues against the merge base with main
niko-kriznik-globtim 5139a0b
build(lint): pin ci-templates c766412
niko-kriznik-globtim 5a5e218
build(lint): pin ci-templates 70dee10
niko-kriznik-globtim 50127cf
fix(ci): fail the secrets check when there are no files to scan
niko-kriznik-globtim ab4c176
build(lint): pin ci-templates 7b12191
niko-kriznik-globtim 387fafc
ci: lint against the parent commit on main and tags
niko-kriznik-globtim 8d36e27
build(lint): pin ci-templates 62b8b95
niko-kriznik-globtim cbb4917
build(lint): pin ci-templates c1d25f4
niko-kriznik-globtim 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
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,29 @@ | ||
| version: "2" | ||
| linters: | ||
| enable: [exhaustive, errorlint, noctx, forbidigo, gocritic] | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| settings: | ||
| errorlint: {errorf: true, asserts: true, comparison: true} | ||
| exhaustive: {check: [switch, map]} | ||
| forbidigo: | ||
| analyze-types: true | ||
| forbid: | ||
| - {pattern: '^os\.Exit$', msg: "return an error; exit only from main.go, or add //nolint:forbidigo // <reason>"} | ||
| - {pattern: '^log\.Fatal(f|ln)?$', msg: "return an error; exit only from main.go, or add //nolint:forbidigo // <reason>"} | ||
| - {pattern: '^zap\.(Logger|SugaredLogger)\.Fatal(f|w|ln)?$', pkg: '^go\.uber\.org/zap$', msg: "Fatal calls os.Exit and skips shutdown; return an error"} | ||
| - {pattern: '^uuid\.MustParse$', pkg: '^github\.com/google/uuid$', msg: "MustParse panics on bad input; use uuid.Parse and return InvalidArgument"} | ||
| - {pattern: '^otlp\w+\.WithInsecure$', msg: "plaintext OTLP exporter; make it a config opt-in or add //nolint:forbidigo // <reason>"} | ||
| - {pattern: '^http\.DefaultClient$', pkg: '^net/http$', msg: "DefaultClient has no timeout; use a client with Timeout"} | ||
| gocritic: | ||
| disable-all: true | ||
| enabled-checks: [ruleguard] | ||
| settings: | ||
| ruleguard: | ||
| rules: '${base-path}/lint/rules.go' | ||
| failOn: dsl,import | ||
| exclusions: | ||
| generated: lax | ||
| paths: ['api/oas_.*', 'gen/'] | ||
| rules: | ||
| - {path: '_test\.go$', linters: [forbidigo, gocritic, errorlint, noctx]} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - {path: '(^|/)main\.go$', linters: [forbidigo], text: 'os\.Exit|Fatal'} | ||
| - {path: '(^|/)(seed|test)/', linters: [forbidigo], text: 'MustParse'} | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.