You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rule no_magic_numbers mistakenly flags a range literal, e.g. 7...8, as a magic number, even though it is declared as a static property. Other types of literal values declared in the same way, such as Ints, are not flagged.
Environment
SwiftLint version (run swiftlint version to be sure)?: 0.54
Installation method used (Homebrew, CocoaPods, building from source, etc)?: CocoaPods
Which Xcode version are you using (check xcodebuild -version)?: Xcode 15.1, Build version 15C65
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.
enumConstants{staticletvalidBookingNumberLengthRange=7...8// This triggers a violation}
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Describe the bug
The rule
no_magic_numbers
mistakenly flags a range literal, e.g.7...8
, as a magic number, even though it is declared as a static property. Other types of literal values declared in the same way, such asInt
s, are not flagged.Environment
swiftlint version
to be sure)?: 0.54xcodebuild -version
)?: Xcode 15.1, Build version 15C65echo "[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
.The text was updated successfully, but these errors were encountered: