New Issue Checklist
Describe the bug
I have a specific setting in my .swiftlint.yml to exclude function declarations
line_length:
warning: 120
error: 200
ignores_function_declarations: true
However, this ignores the macro definitions
// Line Length Violation: Line should be 120 characters or less; currently it has 126 characters (line_length)
@freestanding(expression)
public macro obfuscate(_ value: String) -> String = #externalMacro(module: "ObfuscatedStringMacros", type: "ObfuscationMacro")
Complete output when running SwiftLint, including the stack trace and command used
Gives me
Line Length Violation: Line should be 120 characters or less; currently it has 126 characters (line_length)
Environment
- SwiftLint version (run
swiftlint version to be sure)?
0.55.1
- Installation method used (Homebrew, CocoaPods, building from source, etc)?
Homebrew
- Paste your configuration file:
disabled_rules:
- todo
- trailing_comma
- trailing_whitespace
opt_in_rules:
- empty_count
line_length:
warning: 120
error: 200
ignores_comments: true
ignores_function_declarations: true
ignores_interpolated_strings: true
ignores_urls: true
- Are you using nested configurations?
If so, paste their relative paths and respective contents.
No
- Which Xcode version are you using (check
xcodebuild -version)?
Xcode 15.4
- 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.
Create a macro using Xcode and run the linter to recreate the issue
// This triggers a violation:
@freestanding(expression)
public macro obfuscate(_ value: String) -> String = #externalMacro(module: "ObfuscatedStringMacros", type: "ObfuscationMacro")
New Issue Checklist
Describe the bug
I have a specific setting in my
.swiftlint.ymlto exclude function declarationsHowever, this ignores the macro definitions
Complete output when running SwiftLint, including the stack trace and command used
Gives me
Environment
swiftlint versionto be sure)?0.55.1
Homebrew
If so, paste their relative paths and respective contents.
No
xcodebuild -version)?Xcode 15.4
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rulesto 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.Create a macro using Xcode and run the linter to recreate the issue