Skip to content

Fix false positives in vertical_parameter_alignment_on_call with Unicode - #6535

Open
theamodhshetty wants to merge 1 commit into
realm:mainfrom
theamodhshetty:codex/fix-vertical-parameter-alignment-unicode
Open

theamodhshetty wants to merge 1 commit into
realm:mainfrom
theamodhshetty:codex/fix-vertical-parameter-alignment-unicode

Conversation

@theamodhshetty

@theamodhshetty theamodhshetty commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

vertical_parameter_alignment_on_call compared UTF-8 byte columns, causing false positives when a non-ASCII identifier preceded the first argument.

This compares grapheme-cluster columns, following the conversion used by the declaration-alignment rule. Source lines are cached per visitor to avoid repeatedly reading the whole file for each argument. Added regressions cover the reported Cyrillic identifier, the reviewer's 😵‍💫 example, decomposed accents, and genuinely under-/over-indented arguments. The branch is rebased onto current main and uses current example macros.

Validation: swift test --filter 'ControlStatementRuleGeneratedTests|VerticalParameterAlignmentOnCallRuleGeneratedTests' passes in a temporary combined checkout with the exact rule source from this branch; strict lint passes. Whitespace checks pass with Markdown hard-break trailing spaces allowed. Full platform/performance validation remains with CI.

Fixes #6467.

@SwiftLintBot

SwiftLintBot commented Mar 10, 2026 •

Copy link
Copy Markdown
23 Messages
📖 Building this branch resulted in a binary size of 28772.43 KiB vs 28755.54 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.1 s vs 0.1 s on main (0% slower).
📖 Linting Alamofire with this PR took 0.11 s vs 0.11 s on main (0% slower).
📖 Linting Brave with this PR took 0.38 s vs 0.37 s on main (2% slower).
📖 Linting Brigade with this PR took 18.54 s vs 18.66 s on main (0% faster).
📖 Linting DuckDuckGo with this PR took 2.09 s vs 2.07 s on main (0% slower).
📖 Linting Firefox with this PR took 0.74 s vs 0.75 s on main (1% faster).
📖 Linting Kickstarter with this PR took 0.46 s vs 0.45 s on main (2% slower).
📖 Linting Moya with this PR took 0.09 s vs 0.09 s on main (0% slower).
📖 Linting NetNewsWire with this PR took 0.2 s vs 0.19 s on main (5% slower).
📖 Linting Nimble with this PR took 0.1 s vs 0.09 s on main (11% slower).
📖 Linting PocketCasts with this PR took 0.5 s vs 0.5 s on main (0% slower).
📖 Linting Quick with this PR took 0.09 s vs 0.09 s on main (0% slower).
📖 Linting Realm with this PR took 0.22 s vs 0.22 s on main (0% slower).
📖 Linting Sourcery with this PR took 0.15 s vs 0.15 s on main (0% slower).
📖 Linting Swift with this PR took 0.24 s vs 0.24 s on main (0% slower).
📖 Linting SwiftLintPerformanceTests with this PR took 3.77 s vs 3.8 s on main (0% faster).
📖 Linting VLC with this PR took 0.19 s vs 0.19 s on main (0% slower).
📖 Linting Wire with this PR took 0.78 s vs 0.75 s on main (4% slower).
📖 Linting WordPress with this PR took 0.58 s vs 0.58 s on main (0% slower).
📖 This PR fixed a violation in DuckDuckGo: /macOS/DuckDuckGo/Preferences/View/PreferencesAboutView.swift:289:37: Warning: Function parameters should be aligned vertically if they're in multiple lines in a method call (vertical_parameter_alignment_on_call)
📖 This PR fixed a violation in DuckDuckGo: /macOS/DuckDuckGo/NavigationBar/View/AddressBarTextField.swift:1185:45: Warning: Function parameters should be aligned vertically if they're in multiple lines in a method call (vertical_parameter_alignment_on_call)
📖 This PR fixed a violation in DuckDuckGo: /macOS/DuckDuckGo/NavigationBar/View/AddressBarTextField.swift:1186:45: Warning: Function parameters should be aligned vertically if they're in multiple lines in a method call (vertical_parameter_alignment_on_call)

Generated by 🚫 Danger

@theamodhshetty
theamodhshetty force-pushed the codex/fix-vertical-parameter-alignment-unicode branch from ba57504 to f138e9f Compare October 1, 2026 22:06
@theamodhshetty

Copy link
Copy Markdown
Contributor Author

@SimplyDanny Could you take another look when you have time? The Unicode alignment feedback is addressed in f138e9fb: the rule uses grapheme-cluster columns, with your emoji example, decomposed accents, and under-/over-indentation regressions. The recorded review thread is resolved, and the current head has 20 successful checks with Deploy skipped. Please let me know if you would like any further changes. Thanks!

This branch has not been deployed

No deployments
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.

False positive in rule vertical_parameter_alignment_on_call

3 participants