Skip to content

Commit f2bcd10

Browse files
Allow traffic for be forwarded only withing predefined time-frames (#1110)
* Implement tunnel time restrictions * bump golang-ci version in CI/CD, fix some linting issues
1 parent 51434a2 commit f2bcd10

File tree

200 files changed

+1103
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+1103
-363
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
cat .version >> $GITHUB_ENV
2020
2121
- name: Run golangci-lint
22-
uses: golangci/golangci-lint-action@v6
22+
uses: golangci/golangci-lint-action@v7
2323
with:
2424
version: "${{env.GOLANGCI_LINT_VERSION}}"
2525

.golangci.bck.yml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
---
2+
run:
3+
timeout: 5m
4+
build-tags:
5+
- e2e
6+
7+
linters:
8+
enable-all: true
9+
disable:
10+
- contextcheck
11+
- cyclop
12+
- depguard
13+
- execinquery
14+
- exhaustive
15+
- exhaustruct
16+
- exportloopref
17+
- funlen
18+
- gochecknoglobals
19+
- gochecknoinits
20+
- goconst
21+
- godox
22+
- err113
23+
- gomnd
24+
- gomoddirectives
25+
- inamedparam
26+
- intrange
27+
- ireturn
28+
- mnd
29+
- nlreturn
30+
- nonamedreturns
31+
- tagliatelle
32+
- varnamelen
33+
- wrapcheck
34+
- wsl
35+
fast: false
36+
37+
linters-settings:
38+
errcheck:
39+
check-blank: true
40+
gocognit:
41+
min-complexity: 50
42+
gocyclo:
43+
min-complexity: 40
44+
gocritic:
45+
enabled-tags:
46+
- diagnostic
47+
- performance
48+
- style
49+
lll:
50+
line-length: 180
51+
nestif:
52+
min-complexity: 11
53+
goheader:
54+
values:
55+
regexp:
56+
year: "2026"
57+
template-path: .go-header-template.yml
58+
revive:
59+
rules:
60+
- name: unused-parameter
61+
disabled: true
62+
63+
issues:
64+
exclude:
65+
- "Error return value of `cmd.MarkFlag.+` is not checked"
66+
- "Error return value of `net.SplitHostPort` is not checked"
67+
- "Error return value of `w.Write` is not checked"
68+
- "Limiter.WaitN` is not checked"
69+
- "Temporary has been deprecated since Go 1.18 because it shouldn't be used"
70+
- "`nop.+` is unused"
71+
- "can be `expvar.Var`"
72+
- "can be `fmt.Stringer`"
73+
- "missing cases in switch of type Scheme: TunnelScheme"
74+
- "shadow of imported from 'github.com/saucelabs/forwarder/log' package 'log'"
75+
- "string `https?` has \\d+ occurrences"
76+
- "importShadow: shadow of imported package 'url'"
77+
- "commentedOutCode: may want to remove commented-out code"
78+
- "grpc.Dial is deprecated: use NewClient instead"
79+
exclude-files:
80+
- middleware/delegator.go
81+
- utils/cobrautil/templates
82+
- utils/cobrautil/term
83+
- sizesuffix
84+
exclude-rules:
85+
- path: _test\.go
86+
linters:
87+
- bodyclose
88+
- errcheck
89+
- funlen
90+
- gocognit
91+
- gomnd
92+
- gosec
93+
- noctx
94+
- paralleltest
95+
- testpackage
96+
97+
- path: e2e/
98+
linters:
99+
- prealloc
100+
- nakedret
101+
- nosprintfhostport
102+
103+
- path: e2e/run.go
104+
linters:
105+
- forbidigo
106+
text: use of `fmt.Print
107+
108+
- path: internal/martian
109+
linters:
110+
- goheader
111+
112+
- path: internal/martian
113+
linters:
114+
- gosec
115+
source: "uint32\\(len\\(|\\.Len\\(\\)"
116+
117+
- path: internal/martian
118+
linters:
119+
- bodyclose
120+
source: "newConnectResponse\\(|[eE]rrorResponse\\(|http\\.NewResponseController|http\\.NoBody"
121+
122+
- path: internal/martian/context.go
123+
linters:
124+
- forcetypeassert
125+
126+
- path: internal/martian/h2/
127+
linters:
128+
- errcheck
129+
source: "buf"
130+
131+
- path: internal/martian/h2/testing
132+
linters:
133+
- forbidigo
134+
text: use of `fmt.Print
135+
136+
- path: internal/martian/messageview
137+
linters:
138+
- errcheck
139+
140+
- linters:
141+
- thelper
142+
source: "configure: func\\(t \\*testing.T"
143+
144+
- linters:
145+
- gocognit
146+
- gocyclo
147+
- maintidx
148+
source: "func \\(c \\*command\\) runE\\(cmd \\*cobra\\.Command"
149+
150+
- linters:
151+
- gocritic
152+
source: "// output:"
153+
154+
- linters:
155+
- golint
156+
source: 'import _ "embed"'
157+
158+
- linters:
159+
- forcetypeassert
160+
source: "http.DefaultTransport"
161+
162+
- linters:
163+
- lll
164+
source: "//nolint:"
165+
166+
- linters:
167+
- lll
168+
source: "json:"
169+
170+
- linters:
171+
- nosnakecase
172+
source: "func Example"
173+
174+
- path: utils/dnshack/
175+
linters:
176+
- goheader

0 commit comments

Comments
 (0)