Skip to content

Commit 8c1e2f0

Browse files
bombsimontpounds
authored andcommitted
Revert "Bump wsl to v1.2.7"
This reverts commit 14ebae2.
1 parent 14ebae2 commit 8c1e2f0

File tree

11 files changed

+666
-304
lines changed

11 files changed

+666
-304
lines changed

.golangci.example.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,10 @@ linters-settings:
223223
allow-assign-and-call: true
224224
# Allow multiline assignments to be cuddled. Default is true.
225225
allow-multiline-assign: true
226+
# Allow case blocks to end with a whitespace.
227+
allow-case-traling-whitespace: true
226228
# Allow declarations (var) to be cuddled.
227229
allow-cuddle-declarations: false
228-
# Allow trailing comments in ending of blocks
229-
allow-trailing-comment: false
230-
# Force newlines in end of case at this limit (0 = never).
231-
force-case-trailing-whitespace: 0
232230

233231
linters:
234232
enable:

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -824,12 +824,10 @@ linters-settings:
824824
allow-assign-and-call: true
825825
# Allow multiline assignments to be cuddled. Default is true.
826826
allow-multiline-assign: true
827+
# Allow case blocks to end with a whitespace.
828+
allow-case-traling-whitespace: true
827829
# Allow declarations (var) to be cuddled.
828830
allow-cuddle-declarations: false
829-
# Allow trailing comments in ending of blocks
830-
allow-trailing-comment: false
831-
# Force newlines in end of case at this limit (0 = never).
832-
force-case-trailing-whitespace: 0
833831
834832
linters:
835833
enable:

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.12
44

55
require (
66
github.com/OpenPeeDeeP/depguard v1.0.1
7-
github.com/bombsimon/wsl v1.2.7
7+
github.com/bombsimon/wsl v1.2.5
88
github.com/fatih/color v1.7.0
99
github.com/go-critic/go-critic v0.3.5-0.20190904082202-d79a9f0c64db
1010
github.com/go-lintpack/lintpack v0.5.2

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
1111
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
1212
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
1313
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
14-
github.com/bombsimon/wsl v1.2.7 h1:hckBZYt27e6Ff6yqV/SurMUe48BmXzJk/KVjxDyWtUE=
15-
github.com/bombsimon/wsl v1.2.7/go.mod h1:43lEF/i0kpXbLCeDXL9LMT8c92HyBywXb0AsgMHYngM=
14+
github.com/bombsimon/wsl v1.2.5 h1:9gTOkIwVtoDZywvX802SDHokeX4kW1cKnV8ZTVAPkRs=
15+
github.com/bombsimon/wsl v1.2.5/go.mod h1:43lEF/i0kpXbLCeDXL9LMT8c92HyBywXb0AsgMHYngM=
1616
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
1717
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
1818
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=

pkg/config/config.go

+10-12
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,11 @@ type GocognitSettings struct {
255255
}
256256

257257
type WSLSettings struct {
258-
StrictAppend bool `mapstructure:"strict-append"`
259-
AllowAssignAndCallCuddle bool `mapstructure:"allow-assign-and-call"`
260-
AllowMultiLineAssignCuddle bool `mapstructure:"allow-multiline-assign"`
261-
AllowCuddleDeclaration bool `mapstructure:"allow-cuddle-declarations"`
262-
AllowTrailingComment bool `mapstructure:"allow-trailing-comment"`
263-
CaseForceTrailingWhitespaceLimit int `mapstructure:"force-case-trailing-whitespace:"`
258+
StrictAppend bool `mapstructure:"strict-append"`
259+
AllowAssignAndCallCuddle bool `mapstructure:"allow-assign-and-call"`
260+
AllowMultiLineAssignCuddle bool `mapstructure:"allow-multiline-assign"`
261+
AllowCaseTrailingWhitespace bool `mapstructure:"allow-case-trailing-whitespace"`
262+
AllowCuddleDeclaration bool `mapstructure:"allow-cuddle-declarations"`
264263
}
265264

266265
var defaultLintersSettings = LintersSettings{
@@ -292,12 +291,11 @@ var defaultLintersSettings = LintersSettings{
292291
MinComplexity: 30,
293292
},
294293
WSL: WSLSettings{
295-
StrictAppend: true,
296-
AllowAssignAndCallCuddle: true,
297-
AllowMultiLineAssignCuddle: true,
298-
AllowCuddleDeclaration: false,
299-
AllowTrailingComment: false,
300-
CaseForceTrailingWhitespaceLimit: 0,
294+
StrictAppend: true,
295+
AllowAssignAndCallCuddle: true,
296+
AllowMultiLineAssignCuddle: true,
297+
AllowCaseTrailingWhitespace: true,
298+
AllowCuddleDeclaration: false,
301299
},
302300
}
303301

pkg/golinters/wsl.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ func NewWSL() *goanalysis.Linter {
3737
files = []string{}
3838
linterCfg = lintCtx.Cfg.LintersSettings.WSL
3939
processorCfg = wsl.Configuration{
40-
StrictAppend: linterCfg.StrictAppend,
41-
AllowAssignAndCallCuddle: linterCfg.AllowAssignAndCallCuddle,
42-
AllowMultiLineAssignCuddle: linterCfg.AllowMultiLineAssignCuddle,
43-
AllowCuddleDeclaration: linterCfg.AllowCuddleDeclaration,
44-
AllowTrailingComment: linterCfg.AllowTrailingComment,
45-
CaseForceTrailingWhitespaceLimit: linterCfg.CaseForceTrailingWhitespaceLimit,
46-
AllowCuddleWithCalls: []string{"Lock", "RLock"},
47-
AllowCuddleWithRHS: []string{"Unlock", "RUnlock"},
40+
StrictAppend: linterCfg.StrictAppend,
41+
AllowAssignAndCallCuddle: linterCfg.AllowAssignAndCallCuddle,
42+
AllowMultiLineAssignCuddle: linterCfg.AllowMultiLineAssignCuddle,
43+
AllowCaseTrailingWhitespace: linterCfg.AllowCaseTrailingWhitespace,
44+
AllowCuddleDeclaration: linterCfg.AllowCuddleDeclaration,
45+
AllowCuddleWithCalls: []string{"Lock", "RLock"},
46+
AllowCuddleWithRHS: []string{"Unlock", "RUnlock"},
4847
}
4948
)
5049

test/testdata/wsl.go

+1-39
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func allowTrailing(i int) {
159159

160160
case 2:
161161
fmt.Println("two")
162-
// Comments OK too!
162+
163163
case 3:
164164
fmt.Println("three")
165165
}
@@ -172,41 +172,3 @@ func ExampleSomeOutput() {
172172
// Output:
173173
// Hello, world
174174
}
175-
176-
func IncDecStmt() {
177-
counter := 0
178-
for range make([]int, 5) {
179-
counter++
180-
}
181-
182-
type t struct {
183-
counter int
184-
}
185-
186-
x := t{5}
187-
188-
x.counter--
189-
if x.counter > 0 {
190-
fmt.Println("not yet 0")
191-
}
192-
}
193-
194-
func AnonymousBlock() {
195-
func(a, b int) { // ERROR "block should not start with a whitespace"
196-
197-
fmt.Println(a + b)
198-
}(1, 1)
199-
}
200-
201-
func MultilineComment() {
202-
if true {
203-
/*
204-
Ok to start block with
205-
a
206-
long
207-
multiline
208-
cmoment
209-
*/
210-
fmt.Println("true")
211-
}
212-
}

vendor/github.com/bombsimon/wsl/.travis.yml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)