Skip to content

Commit f57a088

Browse files
committed
chore: move show-stats deprecation warning
1 parent 21445de commit f57a088

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

pkg/commands/run.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,7 @@ func (c *runCommand) printDeprecatedLinterMessages(enabledLinters map[string]*li
425425
}
426426

427427
func (c *runCommand) printStats(issues []result.Issue) {
428-
if c.cfg.Run.ShowStats {
429-
c.log.Warnf("The configuration option `run.show-stats` is deprecated, please use `output.show-stats`")
430-
}
431-
432-
if !c.cfg.Run.ShowStats && !c.cfg.Output.ShowStats {
428+
if !c.cfg.Output.ShowStats {
433429
return
434430
}
435431

pkg/config/loader.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ func (l *Loader) handleDeprecation() {
132132
l.log.Warnf("The configuration option `run.skip-dirs-use-default` is deprecated, please use `issues.exclude-dirs-use-default`.")
133133
}
134134
l.cfg.Issues.UseDefaultExcludeDirs = l.cfg.Run.UseDefaultSkipDirs && l.cfg.Issues.UseDefaultExcludeDirs
135+
136+
// The 2 options are false by default.
137+
if l.cfg.Run.ShowStats {
138+
l.log.Warnf("The configuration option `run.show-stats` is deprecated, please use `output.show-stats`")
139+
}
140+
l.cfg.Output.ShowStats = l.cfg.Run.ShowStats || l.cfg.Output.ShowStats
135141
}
136142

137143
func (l *Loader) setConfigFile() error {

0 commit comments

Comments
 (0)