Reputation: 5397
I would like to configure the Swiftlint cyclomatic_complexity
rule to always have the severity level of warning.
Here are the approaches I have tried in the .swiftlint.yml
.
cyclomatic_complexity: warning
cyclomatic_complexity:
severity: warning
Both of these yield the same result. Namely, upon running swiftlint
, before linting it prints the following error.
Invalid configuration for 'cyclomatic_complexity'. Falling back to default.
How do you configure the severity of this rule for swiftlint
, so that it only generates warnings and not errors?
Upvotes: 0
Views: 1786
Reputation: 136
It might be different depending on your SwiftLint version, for me this one works:
cyclomatic_complexity:
ignores_case_statements: true
Upvotes: 0
Reputation: 21
Try this in .swiftlint.yml, it works for me:
cyclomatic_complexity:
warning: 10
error: 20
Upvotes: 0