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

indentation_width is not working well with multiple line if and guard #4961

Open
2 tasks done
miku1958 opened this issue May 5, 2023 · 2 comments
Open
2 tasks done
Labels
bug Unexpected and reproducible misbehavior.

Comments

@miku1958
Copy link

miku1958 commented May 5, 2023

New Issue Checklist

Describe the bug

For example:
image

Complete output when running SwiftLint, including the stack trace and command used

Swift package plugin

Environment

  • SwiftLint version: 0.51.0
  • Installation method used: SPM
  • Paste your configuration file:
opt_in_rules:
  - indentation_width

indentation_width:
   severity: warning 
   indentation_width: 4
   include_comments: false
   include_compiler_directives: false
   trueinclude_multiline_strings: false
  • Are you using nested configurations?
    If so, paste their relative paths and respective contents.
  • Which Xcode version are you using (check xcodebuild -version)?
  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.
// This triggers a violation:
        guard let startSubvalue = subvalue(at: gesture.startLocation, minutes: minutes),
              let currentSubvalue = subvalue(at: gesture.location, minutes: minutes) else {
            return nil
        }
@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label May 19, 2023
@shmilyQin
Copy link

Facing the same issue. could you tell me whether you fix it? Thanks.

@SimplyDanny
Copy link
Collaborator

I suppose this is not straightforward to fix. I'm not going to invest energy into this in the near future. But everyone is free to propose a PR. 😉

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

3 participants