-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Nesting Rule #190
Comments
The nesting rule will throw a violation when types are nested more than 1 level, or statements more than 5 levels. For example: OK class Class0 {
class Class1 {
}
}
Style Violation class Class0 {
class Class1 {
class Class2 {
}
}
}
What you're found is a bug which treated enum cases as a type declaration, which meant that enum cases could also only be nested one level deep, which is not the intention. I just fixed in 2131613. Thanks for reporting this! |
I still have this issue |
@eaigner based on this and the several other bug reports you've filed, you need to update your version of SwiftLint version to the latest (0.9.1), which has all these features. You can tell which version of SwiftLint you're using by running |
Yep. Totally my fault. Sorry. (was |
Can I change settings for this rule? I mean, what if I want to have this rule but I want to have level for type = 3 or something like this |
You can't change the thresholds for |
The issue still persists on I get the warning with following setup
Is it because of the enum inside a func in a struct, or am I missing out something here. |
I am using 0.24.0 and still facing this
|
Still facing this issue "nesting: 3" does not do anything in the config file |
@sbrighiu try this (assuming you want
|
What is the nesting rules supposed to do? I think it doesn't work.
For example, with the nesting rule enabled, I get a warning,
Nesting Violation: Types should be nested at most 1 level deep (nesting)
:But the nesting is correct.
The text was updated successfully, but these errors were encountered: