-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy path.ameba.yml
More file actions
212 lines (163 loc) · 5.22 KB
/
.ameba.yml
File metadata and controls
212 lines (163 loc) · 5.22 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# This configuration file was generated by `ameba --gen-config`
# on 2025-06-02 13:57:07 UTC using Ameba version 1.7.0-dev.
# The point is for the user to remove these configuration records
# one by one as the reported problems are removed from the code base.
#
# For more details on any individual rule, run `ameba --only RuleName`.
# Indicators for comment annotations:
#
# * `Disabled`: The rule is disabled because it does not seem useful for this repo (or in general).
# * `BUG`: A bug in ameba prevents using this rule either entirely or for specific files.
# * `FIXME`: The rule seems useful, but requires some effort to resolve. That's deferred for later.
# * `TODO`: The rule might be useful, but we need to investigate whether we want to use it or not.
Version: "1.7.0-dev"
# Documentation
# =========================
# Disabled: What's the point in alerting about existing TODOs in code?
Documentation/DocumentationAdmonition:
Enabled: false
# Lint
# =========================
Lint/DebugCalls:
Excluded:
# Samples may legitimately use DebugCalls
- samples/**/*
# Explicit tests
- spec/std/pp_spec.cr
Lint/DebuggerStatement:
Excluded:
# Explicit tests
- spec/debug/**/*
# Disabled: `else nil` can be useful to explicitly show the consequence of the else branch
Lint/ElseNil:
Enabled: false
# Disabled: We have an explicit CI job for testing the formatter (both latest
# and head). No reason to run it through ameba.
Lint/Formatting:
Enabled: false
Lint/LiteralInCondition:
Excluded:
# Samples may legitimately use literals in conditions
- samples/**/*
Lint/LiteralInInterpolation:
Excluded:
- spec/std/random_spec.cr # BUG: https://github.com/crystal-ameba/ameba/issues/611
Lint/LiteralsComparison:
Excluded:
# Explicit tests for case equality on literals
- spec/std/{array,char,int,number,regex,string,symbol,tuple,uint}_spec.cr
# TODO: Investigate if some `not_nil!` calls can be avoided.
Lint/NotNil:
Enabled: false
# BUG: https://github.com/crystal-ameba/ameba/issues/605
Lint/SpecFocus:
Enabled: false
Lint/RandZero:
Excluded:
# Explicit tests
- spec/std/random_spec.cr
# FIXME: Resolve shadowing.
Lint/ShadowingOuterLocalVar:
Enabled: false
Lint/SpecFilename:
Excluded:
- spec/compiler/data/**/*
- spec/compiler/lexer/lexer_objects/strings.cr
- spec/debug/**/*
- spec/llvm-ir/**/*
- spec/std/float_printer/ryu_printf_test_cases.cr
# BUG: https://github.com/crystal-ameba/ameba/issues/612
Lint/TopLevelOperatorDefinition:
Enabled: false
# Disabled: We have an explicit CI job for `typos`. No reason to run it through
# ameba.
Lint/Typos:
Enabled: false
# TODO: Investigate unused arguments.
Lint/UnusedArgument:
Enabled: false
# TODO: Investigate unused block arguments.
Lint/UnusedBlockArgument:
Enabled: false
Lint/UselessAssign:
# BUG: https://github.com/crystal-ameba/ameba/issues/447
# This setting is to avoid false positives from the common use of type
# declarations in macro arguments.
ExcludeTypeDeclarations: true
Excluded:
- spec/debug/**/*
- samples/mt_gc_test.cr
# BUG: https://github.com/crystal-ameba/ameba/issues/624
- spec/std/concurrent/select_spec.cr
# Generators assign top-level variables to pass to ECR templates
- scripts/generate_*
# BUG: https://github.com/crystal-ameba/ameba/issues/623
- scripts/github-changelog.cr
# Metrics
# =========================
# Disabled: Lot's of violations. Complexity is very individual.
Metrics/CyclomaticComplexity:
Enabled: false
# Naming
# =========================
# All disabled. There are many violations and some of the rules are questionable.
# TODO: Consider enabling some of these rules.
Naming/AccessorMethodName:
Enabled: false
Naming/BinaryOperatorParameterName:
Enabled: false
Naming/BlockParameterName:
Enabled: false
# Disabled: All violations follow the spelling of identifiers in upstream
# projects, e.g. for lib bindings.
Naming/ConstantNames:
Enabled: false
Naming/MethodNames:
Enabled: false
Naming/PredicateName:
Enabled: false
Naming/QueryBoolMethods:
Enabled: false
Naming/RescuedExceptionsVariableName:
Enabled: false
Naming/TypeNames:
Enabled: false
Naming/VariableNames:
Enabled: false
# Performance
# =========================
Performance/AnyInsteadOfEmpty:
Excluded:
# These specs explicitly test `#any?` implementations
- spec/std/bit_array_spec.cr
- spec/std/enumerable_spec.cr
- spec/std/hash_spec.cr
# Style
# =========================
# All disabled. There are many violations and some of the rules are questionable.
# TODO: Consider enabling some of these rules.
Style/HeredocEscape:
Enabled: false
Style/HeredocIndent:
Enabled: false
Style/MultilineCurlyBlock:
Enabled: false
# Disabled: This rule seems too strict when any negation inside a complex condition is
# considered a violation. https://github.com/crystal-ameba/ameba/issues/621
Style/NegatedConditionsInUnless:
Enabled: false
# BUG: https://github.com/crystal-ameba/ameba/issues/614
Style/ParenthesesAroundCondition:
Enabled: false
Style/PercentLiteralDelimiters:
Enabled: false
Style/RedundantNext:
Enabled: false
Style/RedundantReturn:
Enabled: false
Style/RedundantSelf:
Enabled: false
Style/VerboseBlock:
Enabled: false
Style/WhileTrue:
Enabled: false