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

Fix nested disable commands improved #5797

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

Conversation

mildm8nnered
Copy link
Collaborator

@mildm8nnered mildm8nnered commented Sep 15, 2024

Addresses #5788

The problem is that Regions are created with all of the rule identifiers that are disabled in them, with a new region being created for each swiftlint: command, more or less.

So an inner region may have multiple rules disabled, when disabled commands are nested, but not all of those rules might be violated within that specific region.

I guess people don't actually nest commands much in practice, at least for custom rules, or this would have created more noise.

This was not as hard to fix as I was afraid it might have been.

The basic idea is to remap the regions inside superfluousDisableCommandViolations, so that the new regions describe the specific region that an individual rule is disabled within.

@SwiftLintBot
Copy link

SwiftLintBot commented Sep 15, 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.28s vs 1.28s on main (0% slower)
📖 Linting Brave with this PR took 7.41s vs 7.42s on main (0% faster)
📖 Linting DuckDuckGo with this PR took 5.05s vs 5.05s on main (0% slower)
📖 Linting Firefox with this PR took 10.98s vs 11.03s on main (0% faster)
📖 Linting Kickstarter with this PR took 10.06s vs 10.03s 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.55s vs 2.55s on main (0% slower)
📖 Linting Nimble with this PR took 0.77s vs 0.78s on main (1% faster)
📖 Linting PocketCasts with this PR took 8.7s vs 8.59s on main (1% slower)
📖 Linting Quick with this PR took 0.43s vs 0.44s on main (2% faster)
📖 Linting Realm with this PR took 4.67s vs 4.65s on main (0% slower)
📖 Linting Sourcery with this PR took 2.36s vs 2.37s on main (0% faster)
📖 Linting Swift with this PR took 4.57s vs 4.59s on main (0% faster)
📖 Linting VLC with this PR took 1.25s vs 1.25s on main (0% slower)
📖 Linting Wire with this PR took 18.23s vs 18.18s on main (0% slower)
📖 Linting WordPress with this PR took 11.81s vs 11.82s on main (0% faster)

Generated by 🚫 Danger

@mildm8nnered mildm8nnered marked this pull request as ready for review September 16, 2024 21:52
@mildm8nnered mildm8nnered force-pushed the mildm8nnered-fix-nested-disable-commands-improved branch from 66ff30d to 593b3ad Compare September 18, 2024 18:45
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.

2 participants