summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-01-30 09:23:21 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-01-30 20:12:03 +0100
commit4e84f57efb57f5c8a850e4c1d562a0bcc7bd1700 (patch)
tree678ed4f283b67339c341ad355306ca0d5d771ad8 /config
parentf31a6db797c9251a362ef9f8ad4c03fb608b5ac0 (diff)
Add warnidf template function
Also rename config `ignoreErrors` => `ignoreLogs` But the old still works. Closes #9189
Diffstat (limited to 'config')
-rw-r--r--config/allconfig/allconfig.go16
-rw-r--r--config/allconfig/configlanguage.go4
-rw-r--r--config/allconfig/load.go1
-rw-r--r--config/configProvider.go2
4 files changed, 12 insertions, 11 deletions
diff --git a/config/allconfig/allconfig.go b/config/allconfig/allconfig.go
index 5788e792b..26e402305 100644
--- a/config/allconfig/allconfig.go
+++ b/config/allconfig/allconfig.go
@@ -206,7 +206,7 @@ func (c Config) cloneForLang() *Config {
x.DisableKinds = copyStringSlice(x.DisableKinds)
x.DisableLanguages = copyStringSlice(x.DisableLanguages)
x.MainSections = copyStringSlice(x.MainSections)
- x.IgnoreErrors = copyStringSlice(x.IgnoreErrors)
+ x.IgnoreLogs = copyStringSlice(x.IgnoreLogs)
x.IgnoreFiles = copyStringSlice(x.IgnoreFiles)
x.Theme = copyStringSlice(x.Theme)
@@ -299,9 +299,9 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
}
}
- ignoredErrors := make(map[string]bool)
- for _, err := range c.IgnoreErrors {
- ignoredErrors[strings.ToLower(err)] = true
+ ignoredLogIDs := make(map[string]bool)
+ for _, err := range c.IgnoreLogs {
+ ignoredLogIDs[strings.ToLower(err)] = true
}
baseURL, err := urls.NewBaseURLFromString(c.BaseURL)
@@ -357,7 +357,7 @@ func (c *Config) CompileConfig(logger loggers.Logger) error {
BaseURLLiveReload: baseURL,
DisabledKinds: disabledKinds,
DisabledLanguages: disabledLangs,
- IgnoredErrors: ignoredErrors,
+ IgnoredLogs: ignoredLogIDs,
KindOutputFormats: kindOutputFormats,
CreateTitle: helpers.GetTitleFunc(c.TitleCaseStyle),
IsUglyURLSection: isUglyURL,
@@ -394,7 +394,7 @@ type ConfigCompiled struct {
KindOutputFormats map[string]output.Formats
DisabledKinds map[string]bool
DisabledLanguages map[string]bool
- IgnoredErrors map[string]bool
+ IgnoredLogs map[string]bool
CreateTitle func(s string) string
IsUglyURLSection func(section string) bool
IgnoreFile func(filename string) bool
@@ -501,8 +501,8 @@ type RootConfig struct {
// Enable to disable the build lock file.
NoBuildLock bool
- // A list of error IDs to ignore.
- IgnoreErrors []string
+ // A list of log IDs to ignore.
+ IgnoreLogs []string
// A list of regexps that match paths to ignore.
// Deprecated: Use the settings on module imports.
diff --git a/config/allconfig/configlanguage.go b/config/allconfig/configlanguage.go
index 71bd232de..0b4c74278 100644
--- a/config/allconfig/configlanguage.go
+++ b/config/allconfig/configlanguage.go
@@ -89,8 +89,8 @@ func (c ConfigLanguage) IsLangDisabled(lang string) bool {
return c.config.C.DisabledLanguages[lang]
}
-func (c ConfigLanguage) IgnoredErrors() map[string]bool {
- return c.config.C.IgnoredErrors
+func (c ConfigLanguage) IgnoredLogs() map[string]bool {
+ return c.config.C.IgnoredLogs
}
func (c ConfigLanguage) NoBuildLock() bool {
diff --git a/config/allconfig/load.go b/config/allconfig/load.go
index eceed31f4..cb267422f 100644
--- a/config/allconfig/load.go
+++ b/config/allconfig/load.go
@@ -141,6 +141,7 @@ func (l configLoader) applyConfigAliases() error {
{Key: "indexes", Value: "taxonomies"},
{Key: "logI18nWarnings", Value: "printI18nWarnings"},
{Key: "logPathWarnings", Value: "printPathWarnings"},
+ {Key: "ignoreErrors", Value: "ignoreLogs"},
}
for _, alias := range aliases {
diff --git a/config/configProvider.go b/config/configProvider.go
index 2536639ea..21d832f17 100644
--- a/config/configProvider.go
+++ b/config/configProvider.go
@@ -67,7 +67,7 @@ type AllProvider interface {
NewContentEditor() string
Timeout() time.Duration
StaticDirs() []string
- IgnoredErrors() map[string]bool
+ IgnoredLogs() map[string]bool
WorkingDir() string
EnableEmoji() bool
}