-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathanalysis_options.yaml
91 lines (78 loc) · 2.59 KB
/
analysis_options.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
include: package:very_good_analysis/analysis_options.4.0.0.yaml
analyzer:
exclude:
# General generated files
- '**/*.g.dart'
- '**/*.gr.dart'
- '**/*.gen.dart'
# Flutter
- 'lib/generated_plugin_registrant.dart'
# mockito
- '*.mocks.dart'
- '**/*.mocks.dart'
# freezed
- '**/*.freezed.dart'
# protobuf
- '**/*.pb.dart'
# test_coverage
- test/.test_coverage.dart
# get_it
- '**/*.config.dart'
# Dart Code Metrics plugin (https://dartcodemetrics.dev/) provides many additional rules
# that helped to automate some pieces of our internal team code style based on the best
# industry practices.
plugins:
- dart_code_metrics
strong-mode:
# We've seen errors tied to use of implicit operations similar to the ones described in
# https://dart.dev/guides/language/analysis-options#enabling-additional-type-checks.
# When we do things explicitly there is less room for errors.
implicit-casts: false
implicit-dynamic: false
errors:
missing_required_param: error
missing_return: error
parameter_assignments: error
dart_code_metrics:
metrics:
# NIST 500-235 item 2.5
cyclomatic-complexity: 10
# McConnell, S. (2004), Chapter 7.5: High-Quality Routines: How To Use Routine Parameters. Code Complete, Second Edition, Redmond, WA, USA: Microsoft Press. 174-180
number-of-parameters: 7
# McConnell, S. (2004), Chapter 7.4: High-Quality Routines: How Long Can a Routine Be?. Code Complete, Second Edition, Redmond, WA, USA: Microsoft Press. 173-174
source-lines-of-code: 200
# We use source-lines-of-code instead of this as we don't want to count comment or blank lines.
# lines-of-code: 50
rules:
- avoid-global-state
- avoid-non-null-assertion
- avoid-returning-widgets
- avoid-unnecessary-setstate
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- avoid-unused-parameters
- double-literal-format
- member-ordering-extended:
order:
- constructors
- fields
- getters-setters
- methods
- no-empty-block
- no-equal-then-else
- prefer-conditional-expressions
- prefer-first
- prefer-last
# This improves navigation by matching file content and file name.
- prefer-match-file-name
anti-patterns:
- long-method
- long-parameter-list
linter:
rules:
public_member_api_docs: false
avoid_relative_lib_imports: false
always_use_package_imports: false
prefer_relative_imports: true
one_member_abstracts: false