-
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.
- Fixed function_lines_of_code for top level fumctions
- Refactored tests for function_lines_of_code
- Loading branch information
1 parent
d3a304f
commit a5d7936
Showing
4 changed files
with
66 additions
and
193 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
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" |
41 changes: 41 additions & 0 deletions
41
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,41 @@ | ||
class ClassWithLongMethods { | ||
// 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; | ||
} | ||
} | ||
|
||
// 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.