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

Add line_length parameter: ignores_multiline_strings #6014

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thisIsTheFoxe
Copy link
Contributor

@thisIsTheFoxe thisIsTheFoxe commented Mar 6, 2025

The idea here is:

  1. if line is a string only (within two """)
  2. and if next line that isn't a string only doesn't start with """ -> ignore as it's part of a multiline string
    if 2 is false, then we might be within a string that's concatinated:
let a = "abc" +
"def"
+ "ghi"

- ignore swift multiline strings marked by `"""`

The idea here is:
1. if line is a string only (within two `"""`)
2. and if next line that isn't a string only doesn't start with `"""`
-> ignore as it's part of a multiline string
if 2 is false, then we might be within a string that's concatinated:
```swift
let a = "abc" +
"def" +
"ghi"
```
@SwiftLintBot
Copy link

SwiftLintBot commented Mar 6, 2025

1 Warning
⚠️ If this is a user-facing change, please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
18 Messages
📖 Building this branch resulted in a binary size of 29597.38 KiB vs 29580.32 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 1.66 s vs 0.95 s on main (74% slower).
📖 Linting Alamofire with this PR took 1.28 s vs 1.29 s on main (0% faster).
📖 Linting Brave with this PR took 8.63 s vs 8.63 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 5.79 s vs 5.8 s on main (0% faster).
📖 Linting Firefox with this PR took 11.87 s vs 11.86 s on main (0% slower).
📖 Linting Kickstarter with this PR took 9.97 s vs 9.94 s on main (0% slower).
📖 Linting Moya with this PR took 0.53 s vs 0.53 s on main (0% slower).
📖 Linting NetNewsWire with this PR took 2.89 s vs 2.89 s on main (0% slower).
📖 Linting Nimble with this PR took 0.78 s vs 0.78 s on main (0% slower).
📖 Linting PocketCasts with this PR took 8.86 s vs 8.79 s on main (0% slower).
📖 Linting Quick with this PR took 0.43 s vs 0.44 s on main (2% faster).
📖 Linting Realm with this PR took 4.6 s vs 4.57 s on main (0% slower).
📖 Linting Sourcery with this PR took 2.35 s vs 2.36 s on main (0% faster).
📖 Linting Swift with this PR took 4.81 s vs 4.81 s on main (0% slower).
📖 Linting VLC with this PR took 1.32 s vs 1.33 s on main (0% faster).
📖 Linting Wire with this PR took 18.74 s vs 18.79 s on main (0% faster).
📖 Linting WordPress with this PR took 11.44 s vs 11.44 s on main (0% slower).

Here's an example of your CHANGELOG entry:

* Add `line_length` parameter: `ignores_multiline_strings`.  
  [thisIsTheFoxe](https://github.com/thisIsTheFoxe)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by 🚫 Danger

- omg i get it it's nice and clean but man is it annoying lol
@thisIsTheFoxe thisIsTheFoxe marked this pull request as ready for review March 6, 2025 21:45
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.

2 participants