Skip to content

Commit dd462d5

Browse files
committed
chore: new show-stats default
1 parent d3bf353 commit dd462d5

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

.golangci.next.reference.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4123,8 +4123,8 @@ output:
41234123
- file # filepath, line, and column.
41244124

41254125
# Show statistics per linter.
4126-
# Default: false
4127-
show-stats: true
4126+
# Default: true
4127+
show-stats: false
41284128

41294129

41304130
# Options for analysis running.

jsonschema/golangci.next.jsonschema.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3888,7 +3888,7 @@
38883888
"show-stats": {
38893889
"description": "Show statistics per linter.",
38903890
"type": "boolean",
3891-
"default": false
3891+
"default": true
38923892
},
38933893
"sort-order": {
38943894
"type": "array",

pkg/commands/flagsets.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func setupRunFlagSet(v *viper.Viper, fs *pflag.FlagSet) {
7272
func setupOutputFlagSet(v *viper.Viper, fs *pflag.FlagSet) {
7373
internal.AddFlagAndBind(v, fs, fs.String, "path-prefix", "output.path-prefix", "",
7474
color.GreenString("Path prefix to add to output"))
75-
internal.AddFlagAndBind(v, fs, fs.Bool, "show-stats", "output.show-stats", false, color.GreenString("Show statistics per linter"))
75+
internal.AddFlagAndBind(v, fs, fs.Bool, "show-stats", "output.show-stats", true, color.GreenString("Show statistics per linter"))
7676

7777
setupOutputFormatsFlagSet(v, fs)
7878
}

test/run_test.go

+20-4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func TestAutogeneratedNoIssues(t *testing.T) {
3737

3838
testshared.NewRunnerBuilder(t).
3939
WithConfig(cfg).
40+
WithArgs("--show-stats=false").
4041
WithTargetPath(testdataDir, "autogenerated").
4142
WithBinPath(binPath).
4243
Runner().
@@ -47,6 +48,7 @@ func TestAutogeneratedNoIssues(t *testing.T) {
4748
func TestEmptyDirRun(t *testing.T) {
4849
testshared.NewRunnerBuilder(t).
4950
WithEnviron("GO111MODULE=off").
51+
WithArgs("--show-stats=false").
5052
WithTargetPath(testdataDir, "nogofiles").
5153
Runner().
5254
Install().
@@ -69,6 +71,7 @@ func TestNotExistingDirRun(t *testing.T) {
6971

7072
func TestSymlinkLoop(t *testing.T) {
7173
testshared.NewRunnerBuilder(t).
74+
WithArgs("--show-stats=false").
7275
WithTargetPath(testdataDir, "symlink_loop", "...").
7376
Runner().
7477
Install().
@@ -120,7 +123,9 @@ func TestTestsAreLintedByDefault(t *testing.T) {
120123
func TestCgoOk(t *testing.T) {
121124
testshared.NewRunnerBuilder(t).
122125
WithNoConfig().
123-
WithArgs("--timeout=3m",
126+
WithArgs(
127+
"--timeout=3m",
128+
"--show-stats=false",
124129
"--enable-all",
125130
).
126131
WithTargetPath(testdataDir, "cgo").
@@ -358,7 +363,10 @@ func TestUnsafeOk(t *testing.T) {
358363

359364
testshared.NewRunnerBuilder(t).
360365
WithConfig(cfg).
361-
WithArgs("--enable-all").
366+
WithArgs(
367+
"--show-stats=false",
368+
"--enable-all",
369+
).
362370
WithTargetPath(testdataDir, "unsafe").
363371
WithBinPath(binPath).
364372
Runner().
@@ -371,7 +379,10 @@ func TestSortedResults(t *testing.T) {
371379

372380
testshared.NewRunnerBuilder(t).
373381
WithNoConfig().
374-
WithArgs("--output.text.print-issued-lines=false").
382+
WithArgs(
383+
"--show-stats=false",
384+
"--output.text.print-issued-lines=false",
385+
).
375386
WithTargetPath(testdataDir, "sort_results").
376387
WithBinPath(binPath).
377388
Runner().
@@ -385,7 +396,11 @@ func TestSortedResults(t *testing.T) {
385396
func TestIdentifierUsedOnlyInTests(t *testing.T) {
386397
testshared.NewRunnerBuilder(t).
387398
WithNoConfig().
388-
WithArgs("--disable-all", "-Eunused").
399+
WithArgs(
400+
"--show-stats=false",
401+
"--disable-all",
402+
"-Eunused",
403+
).
389404
WithTargetPath(testdataDir, "used_only_in_tests").
390405
Runner().
391406
Install().
@@ -395,6 +410,7 @@ func TestIdentifierUsedOnlyInTests(t *testing.T) {
395410

396411
func TestUnusedCheckExported(t *testing.T) {
397412
testshared.NewRunnerBuilder(t).
413+
WithArgs("--show-stats=false").
398414
WithConfigFile("testdata_etc/unused_exported/golangci.yml").
399415
WithTargetPath("testdata_etc/unused_exported/...").
400416
Runner().

test/testshared/integration/run.go

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func testOneSource(t *testing.T, log *logutils.StderrLog, binPath, sourcePath st
6363

6464
args := []string{
6565
"--disable-all",
66+
"--show-stats=false",
6667
"--output.json.path=stdout",
6768
"--max-same-issues=100",
6869
"--max-issues-per-linter=100",

0 commit comments

Comments
 (0)