-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.
Description
New Issue Checklist
- [*] Updated SwiftLint to the latest version
- [*] I searched for existing GitHub issues
Describe the bug
Negative numbers (except for -1) will trigger the no_magic_numbers
- e.g. case negative = -2
. Equivalent positive numbers (e.g. 2
) are fine.
Complete output when running SwiftLint, including the stack trace and command used
swiftlint lint Example.swift --enable-all-rules
Linting Swift files at paths Example.swift
Linting 'Example.swift' (1/1)
The `anyobject_protocol` rule is now deprecated and will be completely removed in a future release.
./Example.swift:3:22: warning: No Magic Numbers Violation: Magic numbers should be replaced by named constants. (no_magic_numbers)
Done linting! Found 1 violation, 0 serious in 1 file.
Environment
-
SwiftLint version (run
swiftlint version
to be sure)? 0.50.3 -
Installation method used (Homebrew, CocoaPods, building from source, etc)? Portable
-
Paste your configuration file: None
-
Are you using nested configurations? No
-
Which Xcode version are you using (check
xcodebuild -version
)? 14.2 -
Do you have a sample that shows the issue?
echo "internal enum Example {\n case positive = 2\n case negative = -2\n}" | swiftlint lint --no-cache --use-stdin --enable-all-rules
enum Example: Int {
case positive = 2
case negative = -2
}
Metadata
Metadata
Assignees
Labels
bugUnexpected and reproducible misbehavior.Unexpected and reproducible misbehavior.