File tree Expand file tree Collapse file tree 5 files changed +27
-5
lines changed
Expand file tree Collapse file tree 5 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,13 @@ Then you can see suggestions in your IDE or you can run checks manually:
2929
3030` ` ` bash
3131dart analyze;
32- dart run dart_code_metrics:metrics analyze lib;
33- dart run dart_code_metrics:metrics check-unused-files lib;
34- dart run dart_code_metrics:metrics check-unused-l10n lib;
32+ dart run dart_code_metrics:metrics analyze lib test ;
33+ dart run dart_code_metrics:metrics check-unused-files lib test ;
34+ dart run dart_code_metrics:metrics check-unused-l10n lib test ;
3535
3636` ` `
37+ Beware that some of the `dart_code_metrics` checks are not displayed in IDE so running checks
38+ manually or in your actions (CI) is essential.
3739
3840Learn more : https://github.com/dart-code-checker/dart-code-metrics#cli
3941# Badge
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ environment:
66 sdk : ' >=2.14.4 <3.0.0'
77
88dev_dependencies :
9- dart_code_metrics : ^4.8.0
109 solid_lints :
1110 path : ../
1211 test : ^1.20.1
Original file line number Diff line number Diff line change @@ -30,12 +30,31 @@ dart_code_metrics:
3030 # We use source-lines-of-code instead of this as we don't want to count comment or blank lines.
3131 # lines-of-code: 50
3232 rules :
33+ - avoid-global-state
3334 - avoid-late-keyword
3435 - avoid-non-null-assertion
3536 - avoid-returning-widgets
3637 - avoid-unnecessary-setstate
38+ - avoid-unnecessary-type-assertions
39+ - avoid-unnecessary-type-casts
40+ - avoid-unrelated-type-assertions
41+ - avoid-unused-parameters
42+ - double-literal-format
43+ - member-ordering-extended :
44+ order :
45+ - fields
46+ - getters-setters
47+ - constructors
48+ - methods
3749 - newline-before-return
50+ - no-empty-block
51+ - no-equal-then-else
3852 - no-magic-number
53+ - prefer-conditional-expressions
54+ - prefer-first
55+ - prefer-last
56+ # This improves navigation by matching file content and file name.
57+ - prefer-match-file-name
3958 anti-patterns :
4059 - long-method
4160 - long-parameter-list
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ dart_code_metrics:
4848# many places inside the test code, adding uninformative visual noise.
4949# - The use of this operator is also discouraged by the main ruleset.
5050 avoid-late-keyword : false
51+ # It's acceptable to include stubs or other helper classes into the test file.
52+ prefer-match-file-name : false
5153 anti-patterns :
5254# Same as for `source-lines-of-code`
5355 long-method : false
Original file line number Diff line number Diff line change @@ -7,4 +7,4 @@ environment:
77 sdk : ' >=2.14.4 <3.0.0'
88
99dependencies :
10- dart_code_metrics : ^4.8 .0
10+ dart_code_metrics : ^4.9 .0
You can’t perform that action at this time.
0 commit comments