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

check string before command for invalid_swiftlint_command rule #5204

Merged

Conversation

mildm8nnered
Copy link
Collaborator

@mildm8nnered mildm8nnered commented Sep 4, 2023

Some minor improvements to the invalid_swiftlint_command rule.

Location is now more accurate - we point to the start of the swiftlint command.

Separate reasons are now provided for invalid actions, modifier, or missing rules.

We now check whether swiftlint is preceded by whitespace or a comment / character, so sswiftlint:disable some_rule for example, would now generate a warning.

@SwiftLintBot
Copy link

SwiftLintBot commented Sep 4, 2023

1 Warning
⚠️ This PR may need tests.
17 Messages
📖 Linting Aerial with this PR took 1.2s vs 1.19s on main (0% slower)
📖 Linting Alamofire with this PR took 1.59s vs 1.57s on main (1% slower)
📖 Linting Brave with this PR took 9.0s vs 9.02s on main (0% faster)
📖 Linting DuckDuckGo with this PR took 4.4s vs 4.38s on main (0% slower)
📖 Linting Firefox with this PR took 10.35s vs 10.34s on main (0% slower)
📖 Linting Kickstarter with this PR took 11.32s vs 11.34s on main (0% faster)
📖 Linting Moya with this PR took 0.63s vs 0.63s on main (0% slower)
📖 Linting NetNewsWire with this PR took 3.41s vs 3.43s on main (0% faster)
📖 Linting Nimble with this PR took 0.82s vs 0.81s on main (1% slower)
📖 Linting PocketCasts with this PR took 8.96s vs 8.94s on main (0% slower)
📖 Linting Quick with this PR took 0.39s vs 0.4s on main (2% faster)
📖 Linting Realm with this PR took 13.97s vs 14.0s on main (0% faster)
📖 Linting Sourcery with this PR took 2.51s vs 2.52s on main (0% faster)
📖 Linting Swift with this PR took 5.37s vs 5.36s on main (0% slower)
📖 Linting VLC with this PR took 1.51s vs 1.52s on main (0% faster)
📖 Linting Wire with this PR took 9.26s vs 9.27s on main (0% faster)
📖 Linting WordPress with this PR took 13.43s vs 13.41s on main (0% slower)

Generated by 🚫 Danger

@mildm8nnered mildm8nnered force-pushed the mildm8nnered-check-string-before-command branch from ebebddb to e3cbad4 Compare September 4, 2023 22:58
@mildm8nnered mildm8nnered changed the title Mildm8nnered check string before command check string before command for invalid_swiftlint_command rule Sep 4, 2023
@mildm8nnered mildm8nnered marked this pull request as ready for review September 4, 2023 23:50
Copy link
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvements!

@SimplyDanny SimplyDanny merged commit 8c68e80 into realm:main Sep 5, 2023
5 checks passed
@mildm8nnered mildm8nnered deleted the mildm8nnered-check-string-before-command branch September 26, 2023 22:19
KS1019 pushed a commit to KS1019/SwiftLint that referenced this pull request Oct 2, 2023
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.

3 participants