-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Chris Koch <[email protected]>
- Loading branch information
Showing
3 changed files
with
123 additions
and
0 deletions.
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,29 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
pull-requests: read | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest |
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,66 @@ | ||
linters: | ||
enable: | ||
- containedctx | ||
- gocritic | ||
- godot | ||
- nilerr | ||
- revive | ||
- unconvert | ||
|
||
issues: | ||
include: | ||
- EXC0012 | ||
- EXC0013 | ||
- EXC0014 | ||
- EXC0015 | ||
|
||
linters-settings: | ||
gocritic: | ||
disabledChecks: | ||
- ifElseChain | ||
revive: | ||
# Maximum number of open files at the same time. | ||
# See https://github.com/mgechev/revive#command-line-flags | ||
# Defaults to unlimited. | ||
max-open-files: 2048 | ||
# When set to false, ignores files with "GENERATED" header, similar to golint. | ||
# See https://github.com/mgechev/revive#available-rules for details. | ||
# Default: false | ||
ignore-generated-header: true | ||
# Sets the default severity. | ||
# See https://github.com/mgechev/revive#configuration | ||
# Default: warning | ||
severity: error | ||
# Default: false | ||
# Sets the default failure confidence. | ||
# This means that linting errors with less than 0.8 confidence will be ignored. | ||
# Default: 0.8 | ||
confidence: 0.8 | ||
rules: | ||
- name: blank-imports | ||
- name: context-as-argument | ||
arguments: | ||
- allowTypesBefore: "*testing.T,*github.com/user/repo/testing.Harness" | ||
- name: context-keys-type | ||
- name: error-return | ||
- name: error-strings | ||
- name: error-naming | ||
- name: exported | ||
arguments: | ||
- "checkPrivateReceivers" | ||
- "sayRepetitiveInsteadOfStutters" | ||
- name: if-return | ||
- name: increment-decrement | ||
- name: var-naming | ||
- name: var-declaration | ||
- name: package-comments | ||
- name: range | ||
- name: receiver-naming | ||
- name: time-naming | ||
- name: unexported-return | ||
- name: indent-error-flow | ||
- name: errorf | ||
- name: early-return | ||
- name: file-header | ||
arguments: | ||
- "Copyright 20[1-2][0-9](-20[1-2][0-9])? the u-root Authors. All rights reserved Use of this source code is governed by a BSD-style license that can be found in the LICENSE file." |
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,28 @@ | ||
ignoreGeneratedHeader = false | ||
severity = "warning" | ||
confidence = 0.8 | ||
errorCode = 0 | ||
warningCode = 0 | ||
|
||
[rule.blank-imports] | ||
[rule.context-as-argument] | ||
[rule.context-keys-type] | ||
[rule.dot-imports] | ||
[rule.error-return] | ||
[rule.error-strings] | ||
[rule.error-naming] | ||
[rule.exported] | ||
[rule.if-return] | ||
[rule.increment-decrement] | ||
[rule.var-naming] | ||
[rule.var-declaration] | ||
[rule.package-comments] | ||
[rule.range] | ||
[rule.receiver-naming] | ||
[rule.time-naming] | ||
[rule.unexported-return] | ||
[rule.indent-error-flow] | ||
[rule.errorf] | ||
[rule.early-return] | ||
[rule.file-header] | ||
arguments=["Copyright 20[1-2][0-9](-20[1-2][0-9])? the u-root Authors. All rights reserved Use of this source code is governed by a BSD-style license that can be found in the LICENSE file."] |