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 false positive in toggle_bool rule #3410

Merged
merged 1 commit into from
Nov 8, 2020
Merged

Conversation

marcelofabri
Copy link
Collaborator

Fixes #3398

@SwiftLintBot
Copy link

12 Messages
📖 Linting Aerial with this PR took 0.83s vs 0.83s on master (0% slower)
📖 Linting Alamofire with this PR took 1.02s vs 1.01s on master (0% slower)
📖 Linting Firefox with this PR took 4.0s vs 3.92s on master (2% slower)
📖 Linting Kickstarter with this PR took 6.56s vs 6.63s on master (1% faster)
📖 Linting Moya with this PR took 0.51s vs 0.5s on master (2% slower)
📖 Linting Nimble with this PR took 0.58s vs 0.6s on master (3% faster)
📖 Linting Quick with this PR took 0.33s vs 0.33s on master (0% slower)
📖 Linting Realm with this PR took 1.36s vs 1.38s on master (1% faster)
📖 Linting SourceKitten with this PR took 0.51s vs 0.53s on master (3% faster)
📖 Linting Sourcery with this PR took 2.69s vs 2.62s on master (2% slower)
📖 Linting Swift with this PR took 7.69s vs 7.8s on master (1% faster)
📖 Linting WordPress with this PR took 7.42s vs 7.55s on master (1% faster)

Generated by 🚫 Danger

@marcelofabri marcelofabri merged commit 0e29701 into master Nov 8, 2020
@marcelofabri marcelofabri deleted the mf-bugfix-3398 branch November 8, 2020 13:32
@@ -41,7 +42,7 @@ public struct ToggleBoolRule: SubstitutionCorrectableRule, ConfigurationProvider
}

public func violationRanges(in file: SwiftLintFile) -> [NSRange] {
let pattern = "(?<![\\w.])([\\w.]+) = !\\1\\b"
let pattern = #"(?<![\w.])([\w.]+) = !\1\b(?!\.)"#
Copy link
Contributor

Choose a reason for hiding this comment

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

Simple and effective :) awesome!

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.

[bug] toggle_bool false positive
4 participants