Skip to content

Commit dd62b58

Browse files
De-duplicated linters
Apparently the problem was not Windows but rather CRLF
1 parent da5e311 commit dd62b58

File tree

3 files changed

+95
-161
lines changed

3 files changed

+95
-161
lines changed

.github/workflows/lint.yaml

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
name: Lint
2-
3-
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
8-
9-
jobs:
10-
11-
lint:
12-
strategy:
13-
matrix:
14-
os: [ubuntu, windows]
15-
runs-on: ${{ matrix.os }}-latest
16-
steps:
17-
- uses: actions/checkout@v3
18-
19-
- name: Set up Go
20-
uses: actions/setup-go@v3
21-
with:
22-
go-version-file: go.mod
23-
24-
- name: Linter
25-
uses: golangci/golangci-lint-action@v3
26-
with:
27-
version: latest
28-
args: --config=.golangci-${{ matrix.os }}.yaml
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
11+
lint:
12+
strategy:
13+
matrix:
14+
os: [ubuntu, windows]
15+
runs-on: ${{ matrix.os }}-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version-file: go.mod
23+
24+
- name: Linter
25+
uses: golangci/golangci-lint-action@v3
26+
with:
27+
version: latest
28+
args: --config=.golangci-lint.yaml
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,68 @@
1-
# This is for the CI. To run it, please use:
2-
# golangci-lint run -c .golangci-ubuntu.yaml.
3-
4-
linters:
5-
# linters to run in addition to default ones
6-
enable:
7-
- dupl
8-
- durationcheck
9-
- errname
10-
- errorlint
11-
- exportloopref
12-
- forbidigo
13-
- forcetypeassert
14-
- gci
15-
- godot
16-
- gofmt
17-
- gosec
18-
- misspell
19-
- nolintlint
20-
- revive
21-
- thelper
22-
- tparallel
23-
- unconvert
24-
- unparam
25-
- whitespace
26-
##- wrapcheck # To think properly about it
27-
28-
run:
29-
timeout: 5m
30-
build-tags:
31-
- mock
32-
33-
# Get all linter issues, even if duplicated
34-
issues:
35-
exclude-use-default: false
36-
max-issues-per-linter: 0
37-
max-same-issues: 0
38-
exclude:
39-
# EXC0001 errcheck: most errors are in defer calls, which are safe to ignore and idiomatic Go (would be good to only ignore defer ones though)
40-
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv|w\.Stop). is not checked'
41-
# EXC0008 gosec: duplicated of errcheck
42-
- (G104|G307)
43-
# EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
44-
- Potential file inclusion via variable
45-
# Use of unsafe is unavoidable in this package
46-
- G103
47-
# We don't wrap errors on purpose
48-
- non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
49-
# revive: unexported-return for functions exported only in tests, aliasing doesn't work here as the linter always goes for the underlying model which is unexported
50-
- 'unexported-return: exported func InitialModel(ForTests|WithPrevConfig)? returns unexported type watchdtui.model, which can be annoying to use'
51-
#fix: true # we don’t want this in CI
52-
53-
nolintlint:
54-
require-explanation: true
55-
require-specific: true
56-
57-
linters-settings:
58-
# Forbid the usage of deprecated ioutil and debug prints
59-
forbidigo:
60-
forbid:
61-
- ioutil\.
62-
- ^print.*$
63-
staticcheck:
64-
# Should be better for it to be autodetected
65-
# https://github.com/golangci/golangci-lint/issues/2234
1+
# This is for the CI. To run it, please use:
2+
# golangci-lint run -c .golangci-lint.yaml
3+
# Locally, you can use
4+
# golangci-lint run -c .golangci-lint.yaml --fix
5+
6+
linters:
7+
# linters to run in addition to default ones
8+
enable:
9+
- dupl
10+
- durationcheck
11+
- errname
12+
- errorlint
13+
- exportloopref
14+
- forbidigo
15+
- forcetypeassert
16+
- gci
17+
- godot
18+
- gofmt
19+
- gosec
20+
- misspell
21+
- nolintlint
22+
- revive
23+
- thelper
24+
- tparallel
25+
- unconvert
26+
- unparam
27+
- whitespace
28+
##- wrapcheck # To think properly about it
29+
30+
run:
31+
timeout: 5m
32+
build-tags:
33+
- mock
34+
35+
# Get all linter issues, even if duplicated
36+
issues:
37+
exclude-use-default: false
38+
max-issues-per-linter: 0
39+
max-same-issues: 0
40+
exclude:
41+
# EXC0001 errcheck: most errors are in defer calls, which are safe to ignore and idiomatic Go (would be good to only ignore defer ones though)
42+
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv|w\.Stop). is not checked'
43+
# EXC0008 gosec: duplicated of errcheck
44+
- (G104|G307)
45+
# EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)'
46+
- Potential file inclusion via variable
47+
# Use of unsafe is unavoidable in this package
48+
- G103
49+
# We don't wrap errors on purpose
50+
- non-wrapping format verb for fmt.Errorf. Use `%w` to format errors
51+
# revive: unexported-return for functions exported only in tests, aliasing doesn't work here as the linter always goes for the underlying model which is unexported
52+
- 'unexported-return: exported func InitialModel(ForTests|WithPrevConfig)? returns unexported type watchdtui.model, which can be annoying to use'
53+
#fix: true # we don’t want this in CI
54+
55+
nolintlint:
56+
require-explanation: true
57+
require-specific: true
58+
59+
linters-settings:
60+
# Forbid the usage of deprecated ioutil and debug prints
61+
forbidigo:
62+
forbid:
63+
- ioutil\.
64+
- ^print.*$
65+
staticcheck:
66+
# Should be better for it to be autodetected
67+
# https://github.com/golangci/golangci-lint/issues/2234
6668
go: "1.20"

.golangci-windows.yaml

-68
This file was deleted.

0 commit comments

Comments
 (0)