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

False positive: vertical_parameter_alignment with specific function name #5037

Open
MrCOBA opened this issue May 26, 2023 · 2 comments
Open
Labels
bug Unexpected and reproducible misbehavior.

Comments

@MrCOBA
Copy link

MrCOBA commented May 26, 2023

Describe the bug

Hi! Found a new false positive case of vertical_parameter_alignment. The problem is reproduced on SwiftLint version 0.52.2.
I cannot explain this error, in this case it occurs :

    func сheckprofileexistence(_ param: Bool,
                               param1: Bool,
                               param2: Bool,
                               param3: Bool) -> Bool {
        return false
    }

In the following example, no:

    func foooooooooooooooooooo(_ param: Bool,
                               param1: Bool,
                               param2: Bool,
                               param3: Bool) -> Bool {
        return false
    }

Environment

SwiftLint version 0.52.2
Installation method used swiftlint binary
Paste your configuration file:

only_rules:
  - vertical_parameter_alignment

Are you using nested configurations? No
Which Xcode version are you using? 14.2
Do you have a sample that shows the issue?

    func сheckprofileexistence(_ param: Bool,
                               param1: Bool,
                               param2: Bool,
                               param3: Bool) -> Bool {
        return false
    }
@SimplyDanny
Copy link
Collaborator

The first character of your function name is a Cyrillic с (U+0441). It occupies 4 byte more than an ASCII c.

Admittedly, SwiftLint shouldn't care for the number of bytes but for the length of visible characters only. So this is actually a bug we have also seen in other contexts.

I don't think you rely on this specific character, however. So replacing it with an ASCII c should silence the warning for you.

@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Jun 11, 2023
@SimplyDanny
Copy link
Collaborator

Does my previous comment resolve the issue, @MrCOBA?

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