Skip to content

False positive: vertical_parameter_alignment with specific function name #5037

Closed

Description

@MrCOBA

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
    }

Activity

  1. SimplyDanny commented on Jun 11, 2023

    @SimplyDanny
    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.

  2. added
    bug
    on Jun 11, 2023
  3. SimplyDanny commented on Jul 30, 2023

    @SimplyDanny
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions