Skip to content
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

Nesting counts enum cases wrong #2357

Closed
2 tasks done
juri opened this issue Aug 21, 2018 · 1 comment
Closed
2 tasks done

Nesting counts enum cases wrong #2357

juri opened this issue Aug 21, 2018 · 1 comment
Labels
wontfix Issues that became stale and were auto-closed by a bot.

Comments

@juri
Copy link

juri commented Aug 21, 2018

New Issue Checklist

Bug Report

It looks like the nesting rule counts cases of deeply nested enum with the statement rule while ignoring the nesting level of the enum which is in acceptable bounds. So specify type_level as something well above the statement level, build a pyramid of doom nested types with the enum as the deepest type, and you'll get a warning about the level of nesting of the cases. Example below.

This issue seemed to be related to #190, but I guess is not quite the same?

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint

Loading configuration from '.swiftlint.yml'
Linting Swift files at paths 
Linting 'Nest.swift' (1/1)
/tmp/foo/Nest.swift:6:26: warning: Nesting Violation: Statements should be nested at most 5 levels deep (nesting)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.27.0
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
  • Paste your configuration file:
nesting:
    type_level: 4
  • Are you using nested configurations? No
  • Which Xcode version are you using (check xcode-select -p)? 9.4.1
  • Example:
struct Foo {
    struct Bar {
        struct Zap {
            struct Blarp {
                enum Target: Equatable {
                    case contentSourceParam(name: String)
                }
            }
        }
    }
}
@stale
Copy link

stale bot commented Nov 8, 2020

This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!

@stale stale bot added the wontfix Issues that became stale and were auto-closed by a bot. label Nov 8, 2020
@stale stale bot closed this as completed Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Issues that became stale and were auto-closed by a bot.
Projects
None yet
Development

No branches or pull requests

2 participants