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 should exclude indentation within multiline strings #4248

Closed
2 tasks done
robertlacroix opened this issue Sep 26, 2022 · 0 comments · Fixed by #4785
Closed
2 tasks done

indentation_width should exclude indentation within multiline strings #4248

robertlacroix opened this issue Sep 26, 2022 · 0 comments · Fixed by #4785

Comments

@robertlacroix
Copy link

New Issue Checklist

Describe the bug

indentation_width probably shouldn't flag content in multiline strings, as it's likely not Swift code and might follow different indentation norms.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint test.swift --config indent.yml
Linting Swift files at paths test.swift
Linting 'test.swift' (1/1)
test.swift:3:1: warning: Indentation Width Violation: Code should be indented using one tab or 4 spaces. (indentation_width)
Done linting! Found 1 violation, 0 serious in 1 file.

$ cat test.swift
let jsonFixture = """
{
  "test": true
}
"""

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.49.1
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? building from source
  • Paste your configuration file:
opt_in_rules:
  indentation_width
@robertlacroix robertlacroix changed the title indentation_width should exclude indentation within multiline strings indentation_width should exclude indentation within multiline strings Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants