Skip to content

Commit

Permalink
Nested control flow (#485)
Browse files Browse the repository at this point in the history
* new check NestedControlFlow
  • Loading branch information
AlexHaxe authored Oct 24, 2019
1 parent 2ffdb22 commit a4bde32
Show file tree
Hide file tree
Showing 9 changed files with 351 additions and 73 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- New check `EnforceVarTypeHint` to enforce type hints for all variables and finals, fixes [#464](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/464) ([#481](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/481) + [#482](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/482))
- New check `AvoidIdentifier` marks identifiers to avoid ([#483](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/483))
- New check `ArrowFunction` to check for curlies, nested functions and returns in arrow functions ([#484](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/484))
- New check `NestedControlFlow` to check for nested control flow expressions (e.g. `if`, `for`, `while`, `do/while`, `switch` and `try`) ([#485](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/485))
- Added coverage upload to codeclimate ([#478](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/478))
- Fixed allow excluding construtor (`new`) via range exclusion ([#479](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/479))
- Refactored build system to use lix ([#478](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/478))
Expand Down
72 changes: 38 additions & 34 deletions resources/checkstyle-excludes-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"UnusedImport": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 77
"propertyOrder": 78
},
"Dynamic": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -38,7 +38,7 @@
},
"SeparatorWhitespace": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 63
"propertyOrder": 64
},
"all": {
"$ref": "#/definitions/ExcludeFilterList"
Expand All @@ -49,7 +49,7 @@
},
"NestedForDepth": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 48
"propertyOrder": 49
},
"Anonymous": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -61,7 +61,7 @@
},
"NestedTryDepth": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 50
"propertyOrder": 51
},
"BlockBreakingConditional": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -81,7 +81,7 @@
},
"ReturnCount": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 61
"propertyOrder": 62
},
"DefaultComesLast": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -93,7 +93,7 @@
},
"WhitespaceAfter": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 80
"propertyOrder": 81
},
"ConstantName": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -109,19 +109,19 @@
},
"WhitespaceAround": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 81
"propertyOrder": 82
},
"NestedIfDepth": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 49
"propertyOrder": 50
},
"ParameterName": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 54
"propertyOrder": 55
},
"NullableParameter": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 51
"propertyOrder": 52
},
"InlineFinal": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -133,27 +133,27 @@
},
"SeparatorWrap": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 64
"propertyOrder": 65
},
"AvoidIdentifier": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 8
},
"RedundantAllowMeta": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 58
"propertyOrder": 59
},
"HiddenField": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 29
},
"UnnecessaryConstructor": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 76
"propertyOrder": 77
},
"SimplifyBooleanExpression": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 65
"propertyOrder": 66
},
"path": {
"description": "filters excludes relative to\n\t- RELATIVE_TO_PROJECT = use project root\n\t- RELATIVE_TO_SOURCE = use path(s) specified via \"-s <path>\" command line switches",
Expand All @@ -169,27 +169,27 @@
},
"UnusedLocalVar": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 78
"propertyOrder": 79
},
"TabForAligning": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 70
"propertyOrder": 71
},
"MethodName": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 43
},
"RightCurly": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 62
"propertyOrder": 63
},
"AvoidTernaryOperator": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 10
},
"ParameterNumber": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 55
"propertyOrder": 56
},
"ArrowFunction": {
"$ref": "#/definitions/ExcludeFilterList",
Expand Down Expand Up @@ -217,15 +217,15 @@
},
"RedundantModifier": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 59
"propertyOrder": 60
},
"Type": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 73
"propertyOrder": 74
},
"TypeName": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 75
"propertyOrder": 76
},
"Indentation": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -238,23 +238,27 @@
},
"Return": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 60
"propertyOrder": 61
},
"SimplifyBooleanReturn": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 66
"propertyOrder": 67
},
"TODOComment": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 69
"propertyOrder": 70
},
"NestedControlFlow": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 48
},
"OperatorWhitespace": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 52
"propertyOrder": 53
},
"Spacing": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 67
"propertyOrder": 68
},
"IndentationCharacter": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -270,11 +274,11 @@
},
"TrailingWhitespace": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 72
"propertyOrder": 73
},
"VariableInitialisation": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 79
"propertyOrder": 80
},
"LineLength": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -294,19 +298,19 @@
},
"StringLiteral": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 68
"propertyOrder": 69
},
"Trace": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 71
"propertyOrder": 72
},
"ArrayAccess": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 5
},
"PublicAccessor": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 56
"propertyOrder": 57
},
"DocCommentStyle": {
"$ref": "#/definitions/ExcludeFilterList",
Expand All @@ -318,19 +322,19 @@
},
"RedundantAccessMeta": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 57
"propertyOrder": 58
},
"CodeSimilarity": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 13
},
"OperatorWrap": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 53
"propertyOrder": 54
},
"TypeDocComment": {
"$ref": "#/definitions/ExcludeFilterList",
"propertyOrder": 74
"propertyOrder": 75
},
"LeftCurly": {
"$ref": "#/definitions/ExcludeFilterList",
Expand Down
Loading

0 comments on commit a4bde32

Please sign in to comment.