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

opening_brace rule bug fixes #4658

Merged

Conversation

mildm8nnered
Copy link
Collaborator

@mildm8nnered mildm8nnered commented Dec 24, 2022

Fix for #3712

In the example given for the defect

             class TestFile {
                   func problemFunction() {
                       #if DEBUG
                       #endif
                   }
                   func openingBraceViolation()
                   {
                       print("Brackets")
                   }
               }

The if in #endif was being matched by the regex. I added in a word boundary (\b), to make sure that if, guard and while are only matched if they start at a word boundary

@SwiftLintBot
Copy link

SwiftLintBot commented Dec 24, 2022

7 Warnings
⚠️ This PR introduced a violation in NetNewsWire: /Mac/AppDelegate.swift:34:1: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
⚠️ This PR introduced a violation in Swift: /benchmark/single-source/CodableTest.swift:79:69: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
⚠️ This PR introduced a violation in Swift: /validation-test/IDE/crashers_fixed/010-swift-archetypebuilder-addrequirement.swift:2:6: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
⚠️ This PR introduced a violation in Swift: /validation-test/IDE/crashers_fixed/010-swift-archetypebuilder-addrequirement.swift:3:11: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
⚠️ This PR introduced a violation in Swift: /validation-test/IDE/crashers_fixed/087-swift-declcontext-getparentmodule.swift:2:12: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
⚠️ This PR introduced a violation in Swift: /validation-test/IDE/crashers_fixed/087-swift-declcontext-getparentmodule.swift:2:26: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
⚠️ This PR introduced a violation in Swift: /validation-test/IDE/crashers_fixed/087-swift-declcontext-getparentmodule.swift:2:34: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
28 Messages
📖 Linting Aerial with this PR took 0.25s vs 0.25s on main (0% slower)
📖 Linting Alamofire with this PR took 0.26s vs 0.26s on main (0% slower)
📖 Linting Brave with this PR took 1.49s vs 1.49s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 0.63s vs 0.63s on main (0% slower)
📖 Linting Firefox with this PR took 1.35s vs 1.36s on main (0% faster)
📖 Linting Kickstarter with this PR took 1.78s vs 1.78s on main (0% slower)
📖 Linting Moya with this PR took 0.15s vs 0.15s on main (0% slower)
📖 Linting NetNewsWire with this PR took 0.64s vs 0.64s on main (0% slower)
📖 Linting Nimble with this PR took 0.16s vs 0.16s on main (0% slower)
📖 Linting PocketCasts with this PR took 1.3s vs 1.31s on main (0% faster)
📖 Linting Quick with this PR took 0.09s vs 0.11s on main (18% faster)
📖 Linting Realm with this PR took 8.56s vs 8.55s on main (0% slower)
📖 Linting SourceKitten with this PR took 0.13s vs 0.16s on main (18% faster)
📖 Linting Sourcery with this PR took 0.44s vs 0.46s on main (4% faster)
📖 Linting Swift with this PR took 1.11s vs 1.12s on main (0% faster)
📖 Linting VLC with this PR took 0.32s vs 0.32s on main (0% slower)
📖 Linting Wire with this PR took 1.73s vs 1.74s on main (0% faster)
📖 Linting WordPress with this PR took 2.25s vs 2.26s on main (0% faster)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/026-swift-mangle-mangler-mangletype.swift:2:15: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/026-swift-mangle-mangler-mangletype.swift:2:25: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/026-swift-mangle-mangler-mangletype.swift:2:32: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/026-swift-mangle-mangler-mangletype.swift:2:52: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/026-swift-mangle-mangler-mangletype.swift:2:59: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/026-swift-mangle-mangler-mangletype.swift:2:68: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/026-swift-mangle-mangler-mangletype.swift:2:6: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/049-swift-typechecker-resolvewitness.swift:2:11: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/049-swift-typechecker-resolvewitness.swift:2:20: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)
📖 This PR fixed a violation in Swift: /validation-test/IDE/crashers_fixed/049-swift-typechecker-resolvewitness.swift:2:32: warning: Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

Generated by 🚫 Danger

@mildm8nnered mildm8nnered changed the title Mildm8nnered opening brace rule bug fixes opening_brace rule bug fixes Dec 24, 2022
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.

LGTM!

@mildm8nnered mildm8nnered marked this pull request as ready for review December 25, 2022 10:41
@SimplyDanny SimplyDanny merged commit 58611e6 into realm:main Dec 25, 2022
@mildm8nnered mildm8nnered deleted the mildm8nnered-opening-brace-rule-bug-fixes branch December 27, 2022 09:46
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