realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.46k stars 2.2k forks source link

There is a problem with allowed_symbols rule configuration after updating to 0.54.0 #5565

Closed tema-tian closed 1 month ago

tema-tian commented 1 month ago

SwiftLint upgraded from 0.53.0 to 0.54.0, allowed_symbols configuration of type_name does not work

Configuration of type_name

type_name:
  allowed_symbols: ['_']
  min_length: 3
  unallowed_symbols_severity: warning
  validates_start_with_lowercase: error
  severity: warning

Error message

Type Name Violation: Type name 'Tra_xxx_xxx' should only contain alphanumeric and other allowed characters (type_name)
SimplyDanny commented 1 month ago

There should also be a warning that says something like "warning: Configuration for 'type_name' rule contains the invalid key(s) 'severity'.". The severity key was actually just ignored previously, but now invalid keys are reported.

So far so good ... unfortunately this invalid key leads to the whole configuration being dropped and thus the default is used. This shouldn't be the case. Reporting is enough as an invalid key doesn't influence anything. I'll come up with a fix ...