-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added `excludeNames` param for `function_lines_of_code` lint - Refactored tests for function_lines_of_code
- Loading branch information
1 parent
8ed3f80
commit 9adae1f
Showing
6 changed files
with
96 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
lint_test/function_lines_of_code_test/analysis_options.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
analyzer: | ||
plugins: | ||
- ../custom_lint | ||
|
||
custom_lint: | ||
rules: | ||
- function_lines_of_code: | ||
max_lines: 5 | ||
excludeNames: | ||
- "longFunctionExcluded" | ||
- "longMethodExcluded" |
57 changes: 57 additions & 0 deletions
57
lint_test/function_lines_of_code_test/function_lines_of_code_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
class ClassWithLongMethods { | ||
int notLongMethod() { | ||
var i = 0; | ||
i++; | ||
i++; | ||
i++; | ||
return i; | ||
} | ||
|
||
// expect_lint: function_lines_of_code | ||
int longMethod() { | ||
var i = 0; | ||
i++; | ||
i++; | ||
i++; | ||
i++; | ||
return i; | ||
} | ||
|
||
// Excluded by excludeNames | ||
int longMethodExcluded() { | ||
var i = 0; | ||
i++; | ||
i++; | ||
i++; | ||
i++; | ||
return i; | ||
} | ||
} | ||
|
||
int notLongFunction() { | ||
var i = 0; | ||
i++; | ||
i++; | ||
i++; | ||
return i; | ||
} | ||
|
||
// expect_lint: function_lines_of_code | ||
int longFunction() { | ||
var i = 0; | ||
i++; | ||
i++; | ||
i++; | ||
i++; | ||
return i; | ||
} | ||
|
||
// Excluded by excludeNames | ||
int longFunctionExcluded() { | ||
var i = 0; | ||
i++; | ||
i++; | ||
i++; | ||
i++; | ||
return i; | ||
} |
This file was deleted.
Oops, something went wrong.