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

Remove severity as a baseline key, as it interacts poorly with `--strict` #5566

Closed mildm8nnered closed 1 month ago

mildm8nnered commented 1 month ago

I've been dogfooding baselines, and there's an unfortunate interaction with --strict, because we use severity as part of the key for determining which violations are new.

The original idea behind including severity was that if some violations are warnings, and they suddenly become errors, then maybe you would want to know about that.

But of course, with --strict, all warning become errors, but you probably don't want to get alerted to thousands of violations.

My use case was danger, where I have swiftlint.lint_files inline_mode: true, fail_on_error: true, additional_swiftlint_args: '--strict' in my dangerfile

SwiftLintBot commented 1 month ago
1 Warning
:warning: If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
17 Messages
:book: Linting Aerial with this PR took 0.81s vs 0.81s on main (0% slower)
:book: Linting Alamofire with this PR took 1.13s vs 1.18s on main (4% faster)
:book: Linting Brave with this PR took 6.61s vs 6.59s on main (0% slower)
:book: Linting DuckDuckGo with this PR took 3.57s vs 3.51s on main (1% slower)
:book: Linting Firefox with this PR took 9.36s vs 9.32s on main (0% slower)
:book: Linting Kickstarter with this PR took 8.17s vs 8.04s on main (1% slower)
:book: Linting Moya with this PR took 0.51s vs 0.51s on main (0% slower)
:book: Linting NetNewsWire with this PR took 2.38s vs 2.35s on main (1% slower)
:book: Linting Nimble with this PR took 0.7s vs 0.69s on main (1% slower)
:book: Linting PocketCasts with this PR took 6.92s vs 6.89s on main (0% slower)
:book: Linting Quick with this PR took 0.33s vs 0.34s on main (2% faster)
:book: Linting Realm with this PR took 4.0s vs 4.02s on main (0% faster)
:book: Linting Sourcery with this PR took 2.1s vs 2.06s on main (1% slower)
:book: Linting Swift with this PR took 3.88s vs 3.89s on main (0% faster)
:book: Linting VLC with this PR took 1.13s vs 1.16s on main (2% faster)
:book: Linting Wire with this PR took 14.28s vs 14.3s on main (0% faster)
:book: Linting WordPress with this PR took 9.73s vs 9.64s on main (0% slower)

Here's an example of your CHANGELOG entry:

* Remove severity as a baseline key, as it interacts poorly with `--strict`.  
  [mildm8nnered](https://github.com/mildm8nnered)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by :no_entry_sign: Danger

mildm8nnered commented 1 month ago

Not strictly user facing, and the baseline file format is unchanged, so I don't think this needs a changelog entry.