@@ -17,6 +17,14 @@ var pathKeys = []string{
1717 "StylesPath" ,
1818}
1919
20+ // nonOptKeys are core keys that something other than `coreOpts` reads.
21+ //
22+ // They belong at the top level, so they're not a mistake -- they just aren't
23+ // resolved here. See `GetPackages`.
24+ var nonOptKeys = []string {
25+ "Packages" ,
26+ }
27+
2028// noChildSections disables the ini library's child-section feature.
2129//
2230// That feature reads a `.` in a section's name as nesting, so `[*.md]` is
@@ -375,6 +383,19 @@ func processConfig(uCfg *ini.File, cfg *Config, dry bool) (*ini.File, error) {
375383 } else if _ , found = syntaxOpts [k ]; found {
376384 msg := fmt .Sprintf ("'%s' is a syntax-specific option" , k )
377385 return nil , NewE201FromTarget (msg , k , cfg .RootINI )
386+ } else if ! StringInSlice (k , nonOptKeys ) {
387+ // Nothing reads a key we don't recognize here, so leaving it be
388+ // quietly means the user's config says something Vale never hears.
389+ //
390+ // The delimiters include `:`, which is what makes this worth
391+ // saying out loud: a URL left on a line of its own parses as the
392+ // key `https` with the rest of itself for a value, and the package
393+ // it was meant to name is never installed.
394+ //
395+ // It's a warning rather than an error because a config that has
396+ // carried a stale key for years still lints exactly as it did.
397+ Warn (fmt .Sprintf (
398+ "'%s' isn't a core option; Vale is ignoring it." , k ))
378399 }
379400 }
380401
0 commit comments