SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Add `scope_depth` rule to validate that scopes aren't nested more than `N` levels deep

Open dalemyers opened this issue 4 years ago • 3 comments

N defaults to 10 for warnings and 7 for errors, but is configurable.

Why do we want/need this rule? Swift relies heavily on closures and it's very easy to end up in a pyramid of doom. By enforcing a max depth, developers are forced to re-evaluate and refactor their code so that it does not end up in this state.

Some non-triggering examples:

struct F0 { }
struct F0 { struct F1 { struct F2 { Struct F3 { struct F4 { struct F5 { struct F6 { struct F7 {}}}}}}}}

A couple of triggering examples (these can be quite large):

struct F0 { struct F1 { struct F2 { Struct F3 { struct F4 { struct F5 { struct F6 { struct F7 { ↓struct F8 { ↓struct F9 { ↓struct F10 { ↓struct F11 {}}}}}}}}}}}}"

Triggers warning on F8, F9 and F10, and errors on F11.

class Zero {
  class One {
    class Two {
      func three() {
        if 4 == 4 {
          repeat {
            if 6 == 6 {
              callFunc() {
                ↓print("Eight")
                ↓if 8 == 8 ↓{
                  ↓print("Nine")
                  ↓if 9 == 9 ↓{
                    ↓if 10 == 10 ↓{
                      ↓{
                        print("Bad")
                      }
                    }
                  }
                }
              }
            }
          } while 5 == 5
        }
      }
    }
  }
}

Once the error level is reached, anything deeper is ignored to avoid excessive noise.

I'm not entirely happy with the naming, so definitely open to changes there.

This is my first real PR for SwiftLint, so there's probably a lot I've missed or misunderstood.

dalemyers avatar Aug 17 '21 16:08 dalemyers

822 Warnings
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:197:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:197:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:199:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:199:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:201:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/Forecast.swift:201:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:53:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:53:39: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:53:46: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:53:62: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:54:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:54:39: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:54:46: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:54:62: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:61:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:61:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:61:49: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:61:61: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:61:71: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:63:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/GeoCoding.swift:63:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:229:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:231:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:231:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:233:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:233:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:249:25: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:249:30: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:249:43: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:250:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:250:44: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:250:60: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:252:111: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:252:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:252:36: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:252:55: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:252:79: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:252:95: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:253:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:255:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:255:44: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:256:36: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:257:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:257:44: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:259:25: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:259:30: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:260:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OneCall.swift:260:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OpenWeather.swift:193:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OpenWeather.swift:195:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OpenWeather.swift:195:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OpenWeather.swift:197:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Models/API/OpenWeather.swift:197:40: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:101:37: error: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:102:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:102:38: error: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:103:37: error: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:106:30: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:106:43: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:107:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:80:30: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:80:43: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:82:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:83:30: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:83:43: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:84:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:94:30: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:94:43: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:97:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:97:47: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:97:49: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:98:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:99:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/Weather/WeatherLayer.swift:99:38: error: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/Request.swift:1384:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/Request.swift:1384:56: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/Request.swift:1384:67: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:250:66: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:250:78: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:250:80: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:256:41: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:268:41: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:365:66: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:365:78: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:365:80: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:371:41: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Alamofire: /Source/ResponseSerialization.swift:384:41: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:120:100: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:120:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:120:71: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:120:91: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:120:98: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:121:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:86:26: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:86:39: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:86:42: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:86:46: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:87:25: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:88:25: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:89:25: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:89:39: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:89:67: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:89:72: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:90:25: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:90:32: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:90:44: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:90:77: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:91:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:91:42: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:91:70: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:92:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:92:44: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:92:46: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:92:56: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:94:25: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:94:39: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/FxAPushMessageHandler.swift:94:45: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:159:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:159:39: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:159:72: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:160:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:160:47: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:160:53: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:163:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:164:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:164:44: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:164:63: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:164:77: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:164:91: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:165:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:167:29: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:167:43: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:167:49: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Account/SyncAuthState.swift:167:58: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Client/Frontend/Browser/BrowserViewController.swift:821:98: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Client/Frontend/Browser/BrowserViewController.swift:823:33: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Client/Frontend/Browser/BrowserViewController.swift:823:63: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Client/Frontend/Browser/BrowserViewController.swift:823:68: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Client/Frontend/Browser/BrowserViewController.swift:823:83: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: This PR introduced a violation in Firefox: /Client/Frontend/Reader/ReaderModeHandlers.swift:64:116: warning: Scope Depth Violation: Exceeds configured scope depth: warningDepth: 7, errorDepth: 10 (scope_depth)
:warning: Danger found 822 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 140.
12 Messages
:book: Linting Aerial with this PR took 0.73s vs 0.73s on master (0% slower)
:book: Linting Alamofire with this PR took 0.96s vs 0.95s on master (1% slower)
:book: Linting Firefox with this PR took 3.42s vs 3.4s on master (0% slower)
:book: Linting Kickstarter with this PR took 5.64s vs 5.62s on master (0% slower)
:book: Linting Moya with this PR took 0.46s vs 0.49s on master (6% faster)
:book: Linting Nimble with this PR took 0.4s vs 0.4s on master (0% slower)
:book: Linting Quick with this PR took 0.18s vs 0.18s on master (0% slower)
:book: Linting Realm with this PR took 2.17s vs 2.16s on master (0% slower)
:book: Linting SourceKitten with this PR took 0.33s vs 0.33s on master (0% slower)
:book: Linting Sourcery with this PR took 1.96s vs 1.95s on master (0% slower)
:book: Linting Swift with this PR took 3.16s vs 3.15s on master (0% slower)
:book: Linting WordPress with this PR took 6.26s vs 6.25s on master (0% slower)

Generated by :no_entry_sign: Danger

SwiftLintBot avatar Aug 17 '21 16:08 SwiftLintBot

Maybe you can explain what prompted this rule? Others might be seeing it.

aaroncrespo avatar Aug 18 '21 13:08 aaroncrespo

Do you think instead of a new rule we can accomplish this with some options on https://realm.github.io/SwiftLint/nesting.html ?

aaroncrespo avatar Aug 20 '21 15:08 aaroncrespo