Skip to content
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

Added lenient command line option #5801

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mildm8nnered
Copy link
Collaborator

@mildm8nnered mildm8nnered commented Sep 20, 2024

Addresses #5779

So I basically just copied #5226 (which I wrote).

If you have strict and lenient as true in the config file, a fatalError will be thrown, but either can be overridden by the --strict or --lenient command line options, and they will also override the opposite setting in the config file.

For example, if you have

lenient: true in your config file, but you specify --strict on the command line, you will get the strict behaviour, and your config file setting will be ignored.

I tested this manually - it was hard to do a unit test, because we fatalError instead of throwing an error right now.

As before, --strict and --lenient on the command line will also fatal error.

@SwiftLintBot
Copy link

SwiftLintBot commented Sep 20, 2024

17 Messages
📖 Linting Aerial with this PR took 0.92s vs 0.92s on main (0% slower)
📖 Linting Alamofire with this PR took 1.25s vs 1.26s on main (0% faster)
📖 Linting Brave with this PR took 7.19s vs 7.2s on main (0% faster)
📖 Linting DuckDuckGo with this PR took 4.98s vs 4.98s on main (0% slower)
📖 Linting Firefox with this PR took 10.31s vs 10.35s on main (0% faster)
📖 Linting Kickstarter with this PR took 9.64s vs 9.59s on main (0% slower)
📖 Linting Moya with this PR took 0.53s vs 0.53s on main (0% slower)
📖 Linting NetNewsWire with this PR took 2.62s vs 2.63s on main (0% faster)
📖 Linting Nimble with this PR took 0.76s vs 0.77s on main (1% faster)
📖 Linting PocketCasts with this PR took 8.48s vs 8.45s on main (0% slower)
📖 Linting Quick with this PR took 0.45s vs 0.46s on main (2% faster)
📖 Linting Realm with this PR took 4.5s vs 4.5s on main (0% slower)
📖 Linting Sourcery with this PR took 2.29s vs 2.3s on main (0% faster)
📖 Linting Swift with this PR took 4.48s vs 4.47s on main (0% slower)
📖 Linting VLC with this PR took 1.25s vs 1.26s on main (0% faster)
📖 Linting Wire with this PR took 17.46s vs 17.42s on main (0% slower)
📖 Linting WordPress with this PR took 11.51s vs 11.53s on main (0% faster)

Generated by 🚫 Danger

@mildm8nnered mildm8nnered force-pushed the mildm8nnered-add-lenient-option-to-config-file branch from 4c5f7d0 to fc3c378 Compare September 21, 2024 18:46
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-add-lenient-option-to-config-file branch from fc3c378 to 5a9b47c Compare September 29, 2024 22:15
@mildm8nnered mildm8nnered marked this pull request as ready for review October 2, 2024 03:19
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-add-lenient-option-to-config-file branch from 5a9b47c to a399c0b Compare October 5, 2024 17:22
@SimplyDanny SimplyDanny linked an issue Oct 7, 2024 that may be closed by this pull request
2 tasks
@SimplyDanny
Copy link
Collaborator

The options turn more and more complex. It'd be really useful to have the combinations tested.

@mildm8nnered mildm8nnered force-pushed the mildm8nnered-add-lenient-option-to-config-file branch from a399c0b to f06b9f3 Compare October 8, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for configuring lenient: true in .swiftlint.yml
3 participants