You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
added ignoreEmptyLines to FileLength and MethodLength checks (#486)
* added ignoreEmptyLines to FileLength and MethodLength checks
* *breaking* removed countEmpty from MethodLength (use ignoreEmptyLines)
* using token count for threshold in CodeSimilarity
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,16 @@
2
2
3
3
## dev branch / next version (2.x.x)
4
4
5
-
- New check `CodeSimilarity` to check for similar or identical code blocks ([#479](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/479) + [#480](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/480) + [#484](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/484))
5
+
-**Breaking Change** changed `MethodLength.countEmpty` into `ignoreEmptyLines`
6
+
- New check `CodeSimilarity` to check for similar or identical code blocks ([#479](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/479) + [#480](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/480) + [#484](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/484) + [#486](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/486))
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))
7
8
- New check `AvoidIdentifier` marks identifiers to avoid ([#483](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/483))
8
9
- New check `ArrowFunction` to check for curlies, nested functions and returns in arrow functions ([#484](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/484))
9
10
- 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))
10
11
- Added coverage upload to codeclimate ([#478](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/478))
12
+
- Added `ignoreEmptyLines` in FileLengthCheck to ignore empty lines (default = true) ([#486](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/486))
13
+
- Changed default value for `max` in `FileLengthCheck` to 1000 ([#486](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/486))
14
+
- Changed `MethodLength` check to use tokentree ([#486](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/486))
11
15
- Fixed allow excluding construtor (`new`) via range exclusion ([#479](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/479))
12
16
- Refactored build system to use lix ([#478](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/478))
13
17
- Refactored / renamed AvoidInlineConditionals to AvoidTernaryOperator ([#479](https://github.com/HaxeCheckstyle/haxe-checkstyle/issues/479))
Copy file name to clipboardExpand all lines: resources/checkstyle-schema.json
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -910,6 +910,11 @@
910
910
"ERROR",
911
911
"IGNORE"
912
912
],
913
+
"propertyOrder": 2
914
+
},
915
+
"ignoreEmptyLines": {
916
+
"description": "ignores or includes empty lines when counting total file length",
917
+
"type": "boolean",
913
918
"propertyOrder": 1
914
919
}
915
920
},
@@ -3513,12 +3518,12 @@
3513
3518
"additionalProperties": false,
3514
3519
"properties": {
3515
3520
"thresholdSimilar": {
3516
-
"description": "threshold for similar code blocks",
3521
+
"description": "maximum number of tokens allowed before detecting similar code blocks",
3517
3522
"type": "integer",
3518
3523
"propertyOrder": 2
3519
3524
},
3520
3525
"thresholdIdentical": {
3521
-
"description": "threshold for identical code blocks",
3526
+
"description": "maximum number of tokens allowed before detecting identical code blocks",
3522
3527
"type": "integer",
3523
3528
"propertyOrder": 1
3524
3529
},
@@ -3927,11 +3932,6 @@
3927
3932
"description": "Checks for long methods. If a method becomes very long it is hard to understand. Therefore long methods should usually be refactored into several individual methods that focus on a specific task.",
3928
3933
"additionalProperties": false,
3929
3934
"properties": {
3930
-
"countEmpty": {
3931
-
"description": "maximum includes empty lines / should ignore empty lines",
3932
-
"type": "boolean",
3933
-
"propertyOrder": 1
3934
-
},
3935
3935
"max": {
3936
3936
"description": "maximum number of lines per method (default: 50)",
3937
3937
"type": "integer",
@@ -3947,6 +3947,11 @@
3947
3947
"IGNORE"
3948
3948
],
3949
3949
"propertyOrder": 2
3950
+
},
3951
+
"ignoreEmptyLines": {
3952
+
"description": "ignores or includes empty lines when counting method length",
Checks for long source files. If a source file becomes very long it is hard to understand.
5
7
Therefore long classes should usually be refactored into several individual classes that focus on a specific task.
6
8
**/
7
9
@name("FileLength")
8
10
@desc("Checks for long source files. If a source file becomes very long it is hard to understand. Therefore long classes should usually be refactored into several individual classes that focus on a specific task.")
9
11
classFileLengthCheckextendsCheck {
10
-
staticvarDEFAULT_MAX_LENGTH:Int=2000;
12
+
staticvarDEFAULT_MAX_LENGTH:Int=1000;
11
13
12
14
/**
13
15
maximum number of lines permitted per file (default: 2000)
14
16
**/
15
17
publicvarmax:Int;
16
18
19
+
/**
20
+
ignores or includes empty lines when counting total file length
0 commit comments