Add versions, improve deprecation system, improve linters page (#1854)

This commit is contained in:
Ludovic Fernandez 2021-03-17 16:17:33 +01:00 committed by GitHub
parent b6a6faa982
commit 8db518cee0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 156 additions and 39 deletions

View file

@ -52,9 +52,16 @@ func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, es *lint
// print deprecated messages
if !cfg.InternalCmdTest {
for name, lc := range enabledLinters {
if lc.IsDeprecated() {
log.Warnf("The linter '%s' is deprecated due to: %s", name, lc.DeprecatedMessage)
if !lc.IsDeprecated() {
continue
}
var extra string
if lc.Deprecation.Replacement != "" {
extra = fmt.Sprintf(" Replaced by %s.", lc.Deprecation.Replacement)
}
log.Warnf("The linter '%s' is deprecated (since %s) due to: %s %s", name, lc.Deprecation.Since, lc.Deprecation.Message, extra)
}
}