File tree Expand file tree Collapse file tree 4 files changed +49
-0
lines changed
golinters/golines/testdata Expand file tree Collapse file tree 4 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,10 @@ func (l *Loader) handleFormatterOverrides() {
223223 if slices .Contains (l .cfg .Formatters .Enable , "gci" ) {
224224 l .cfg .Linters .Settings .Gci = l .cfg .Formatters .Settings .Gci
225225 }
226+
227+ if slices .Contains (l .cfg .Formatters .Enable , "golines" ) {
228+ l .cfg .Linters .Settings .GoLines = l .cfg .Formatters .Settings .GoLines
229+ }
226230}
227231
228232// Add formatter exclusions to linters exclusions.
Original file line number Diff line number Diff line change 1+ //golangcitest:config_path testdata/golines-custom.yml
2+ //golangcitest:expected_exitcode 0
3+ package testdata
4+
5+ // the struct tags should not be reformatted here
6+ type Foo struct {
7+ Bar `a:"b=\"c\"" d:"e"`
8+ Baz `a:"f" d:"g"`
9+ }
10+
11+ var (
12+ // this ends at 80 columns with tab size 2, and would only be a little wider
13+ // with tab size 8, not failing the default line-len, so it checks both
14+ // settings are applied properly
15+ abc = []string {"a string that is only wrapped at narrow widths and wide tabs" }
16+ )
Original file line number Diff line number Diff line change 1+ //golangcitest:config_path testdata/golines-custom.yml
2+ //golangcitest:expected_exitcode 0
3+ package testdata
4+
5+ // the struct tags should not be reformatted here
6+ type Foo struct {
7+ Bar `a:"b=\"c\"" d:"e"`
8+ Baz `a:"f" d:"g"`
9+ }
10+
11+ var (
12+ // this ends at 80 columns with tab size 2, and would only be a little wider
13+ // with tab size 8, not failing the default line-len, so it checks both
14+ // settings are applied properly
15+ abc = []string {
16+ "a string that is only wrapped at narrow widths and wide tabs" ,
17+ }
18+ )
Original file line number Diff line number Diff line change 1+ version : " 2"
2+
3+ formatters :
4+ enable :
5+ - golines
6+ settings :
7+ golines :
8+ # override many settings
9+ max-len : 80
10+ tab-len : 8
11+ reformat-tags : false
You can’t perform that action at this time.
0 commit comments