-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathanalysis_options.yaml
64 lines (53 loc) · 1.52 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
# Configure the analyzer which statically analyzes Dart code.
#
# Invoke the analyzer from the command line:
#
# `flutter analyze`
# Activate recommended lints for Flutter apps, packages, and plugins
# designed to encourage good coding practices.
# include: package:flutter_lints/flutter.yaml
analyzer:
plugins:
- custom_lint
dart_code_metrics:
# anti-patterns:
# - long-method
# - long-parameter-list
metrics:
cyclomatic-complexity: 20
lines-of-executable-code: 50
maximum-nesting-level: 5
number-of-parameters: 5
source-lines-of-code: 200
metrics-exclude:
- test/**
- integration_test/**
- lib/*.g.dart
- lib/*.freezed.dart
rules:
- newline-before-return
- no-boolean-literal-compare
- no-empty-block
- prefer-trailing-comma
- prefer-conditional-expressions
- no-equal-then-else
# - avoid-dynamic
- avoid-nested-conditional-expressions:
acceptable-level: 2
- prefer-first
linter:
# Customise to enable/disable rules in
# `package:flutter_lints/flutter.yaml`.
#
# See https://dart-lang.github.io/linter/lints/index.html.
#
# A lint rule can be suppressed for a single line of code or a
# specific dart file by using the `// ignore: name_of_lint` and `//
# ignore_for_file: name_of_lint`
rules:
avoid_print: true
prefer_single_quotes: true
require_trailing_commas: true
directives_ordering: false
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options