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

Compiler Directives makes opening brace rule violation missed in subsequent function #3712

Closed
2 tasks done
StevenGurrSky opened this issue Sep 10, 2021 · 0 comments
Closed
2 tasks done
Labels
bug Unexpected and reproducible misbehavior.

Comments

@StevenGurrSky
Copy link

New Issue Checklist

Describe the bug

If I have a function containing a compiler directive and a function below that should trigger the opening brace rule, it gets missed.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Linting Swift files in current working directory
Linting 'TestFile.swift' (1/1)
Done linting! Found 0 violations, 0 serious in 1 file.

Environment

  • SwiftLint version: 0.44.0

  • Installation method used: Downloaded from the portable_swiftlint.zip from the 0.44.0 release tag

  • Paste your configuration file: None/default/anything with opening_brace enabled

  • Are you using nested configurations? No

  • Which Xcode version are you using? 12.5.1 (although not relevant)

  • Do you have a sample that shows the issue?

class TestFile {
    func problemFunction() {
        #if DEBUG
        #endif
    }

    func openingBraceViolation()
    {
        print("Brackets")
    }
}

The openingBraceViolation function does not trigger the opening_brace rule as expected.

@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label May 1, 2022
mildm8nnered added a commit to mildm8nnered/SwiftLint that referenced this issue Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

2 participants