-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds baseline
and write_baseline
config file options
#5552
Adds baseline
and write_baseline
config file options
#5552
Conversation
Generated by 🚫 Danger |
1342498
to
01cc6fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is write_baseline
really useful to have in the configuration? That would mean every new violation is directly added to the baseline. But new appearing violations should rather be fixed.
So I don't expect it to get that much use, but I could see a few possible use cases. If you want to generate the Baselines in your CI environment, and can't pass command line options, then this would let you do so without having to reconstruct that environment locally. I could imagine people having a monthly or even yearly job for this. If you wanted to track whether existing violations were getting fixed, you could write out a baseline for the build, and then use |
1217db3
to
f97a825
Compare
f97a825
to
e3830ca
Compare
CHANGELOG.md
Outdated
* Adds `baseline` and `write_baseline` configuration file settings, equivalent | ||
to the `--baseline` and `--write-baseline` command line options. | ||
[Martin Redington](https://github.com/mildm8nnered) | ||
[#5552](https://github.com/realm/SwiftLint/issues/5552) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be moved up into the "Main" section.
… can be used by people who can't pass command line arguments (e.g. plugin users).
Co-authored-by: Danny Mösch <[email protected]>
2c9e59d
to
a90e3c9
Compare
So baselines can be used by people who can't pass command line arguments (e.g. plugin users).
baseline
andwrite_baseline
- these behave exactly the same way as their command line equivalents. The command line will take preference if there is a conflict, but there is not way to "unset" the config file entries from the command line - if there is abaseline
config file entry, you can override it to be a different value, but there is no way to tell SwiftLint "don't read a baseline at all".This is very similar to the PR from a while ago adding a
strict
config option - #5226