SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

OnlyRule not work with custom_rules

Open Ernest0-Production opened this issue 8 months ago • 1 comments

New Issue Checklist

Bug Description

If you specify a custom rule in the --only-rule argument, then no violations are detected during linting. (It does scan the files though)

When linting a built-in rule, everything works correctly

$ swiftlint lint --no-cache --only-rule my_rule

Environment

  • SwiftLint version 0.58.2
  • Xcode version 16.2
  • Installation method used mise-en-place

Ernest0-Production avatar Mar 22 '25 12:03 Ernest0-Production

Historically, handling of custom rules has its peculiarities and we have one of these examples here. Unexpectedly, the command to run a single custom rule is like swiftlint lint --only-rule custom_rules --only-rule my_rule.

SimplyDanny avatar Mar 22 '25 14:03 SimplyDanny