forked from code-dot-org/code-dot-org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.haml-lint.yml
203 lines (199 loc) · 6.4 KB
/
.haml-lint.yml
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
skip_frontmatter: true
inherits_from: .haml-lint_todo.yml
linters:
TrailingWhitespace:
exclude:
- '/**/pegasus/**/*.haml'
- 'pegasus/**/*.haml'
# Custom rule
OnlyAllowedCharacters:
enabled: true
include:
- '/**/*mailer*/**/*.haml'
# as of 2024-01-31, here is the number of violations for each rule. I couldn't
# find a way to autogenerate them using `haml-lint --auto-gen-config`, because
# it seems to want to entirely disable RuboCop. So, I generated this list by
# temporarily removing the list of ignored cops, and then running:
# haml-lint pegasus dashboard shared | grep -o 'RuboCop: [A-Za-z]\+/[A-Za-z]\+' | cut -f 2 -d ' ' | sort | uniq -c | sort -r -n -k 1
# 1253 Style/HashSyntax
# 920 Layout/SpaceAroundOperators
# 636 Layout/SpaceAfterColon
# 255 Layout/SpaceInsideHashLiteralBraces
# 168 Style/QuotedSymbols
# 152 Style/RedundantInterpolation
# 140 Style/CaseEquality
# 122 Layout/SpaceAfterComma
# 69 Naming/VariableName
# 47 Rails/OutputSafety
# 41 Lint/UselessAssignment
# 38 Rails/ContentTag
# 35 Layout/SpaceInsideBlockBraces
# 27 Style/WordArray
# 27 Style/SafeNavigation
# 22 Style/NegatedIf
# 22 Lint/ShadowingOuterLocalVariable
# 21 Style/ConditionalAssignment
# 21 Rails/LinkToBlank
# 17 Layout/SpaceInsideParens
# 14 Style/YodaCondition
# 14 Style/NegatedIfElseCondition
# 14 Style/CaseLikeIf
# 14 Lint/UnusedBlockArgument
# 13 Layout/SpaceBeforeBlockBraces
# 12 Style/StringLiteralsInInterpolation
# 12 Rails/Present
# 11 Style/UnlessElse
# 11 Style/SlicingWithRange
# 11 Style/MultipleComparison
# 11 Rails/RenderInline
# 10 Layout/SpaceInsideArrayLiteralBrackets
# 9 RailsAccessibility/ImageHasAlt
# 8 Style/ParenthesesAroundCondition
# 7 Style/RedundantFreeze
# 7 Style/MethodCallWithoutArgsParentheses
# 7 Lint/AmbiguousOperatorPrecedence
# 5 Style/SoleNestedConditional
# 5 Layout/ArrayAlignment
# 4 Style/NilComparison
# 4 Style/For
# 4 Performance/CollectionLiteralInLoop
# 4 Lint/SymbolConversion
# 4 Layout/SpaceBeforeComma
# 4 Layout/FirstHashElementIndentation
# 3 Style/PreferredHashMethods
# 3 Performance/StringReplacement
# 3 Performance/RegexpMatch
# 3 Performance/MapCompact
# 3 Lint/UnexpectedBlockArity
# 3 Lint/RedundantWithIndex
# 3 Lint/RedundantStringCoercion
# 3 Layout/FirstArrayElementIndentation
# 2 Style/ZeroLengthPredicate
# 2 Style/SelfAssignment
# 2 Style/RedundantConstantBase
# 2 Style/NonNilCheck
# 2 Style/EvenOdd
# 2 Style/EachForSimpleLoop
# 2 Rails/Presence
# 2 Performance/Squeeze
# 2 Performance/Casecmp
# 2 Lint/Syntax
# 2 Lint/SafeNavigationConsistency
# 2 Lint/DeprecatedClassMethods
# 2 Lint/BooleanSymbol
# 2 Layout/SpaceAroundKeyword
# 2 Layout/SpaceAfterNot
# 1 Style/SymbolProc
# 1 Style/SymbolLiteral
# 1 Style/Semicolon
# 1 Style/RedundantStringEscape
# 1 Style/NestedTernaryOperator
# 1 Rails/WhereExists
# 1 Rails/Blank
# 1 Performance/StringIdentifierArgument
# 1 Lint/SafeNavigationChain
# 1 Lint/EmptyConditionalBody
# 1 Lint/AmbiguousBlockAssociation
# 1 Layout/SpaceBeforeFirstArg
# 1 Layout/SpaceAroundBlockParameters
# 1 Layout/MultilineMethodCallBraceLayout
# 1 Layout/IndentationConsistency
# 1 Layout/EndAlignment
RuboCop:
enabled: true
ignored_cops:
- Layout/ArrayAlignment
- Layout/ElseAlignment
- Layout/EndAlignment
- Layout/FirstArrayElementIndentation
- Layout/FirstHashElementIndentation
- Layout/IndentationConsistency
- Layout/IndentationWidth
- Layout/MultilineMethodCallBraceLayout
- Layout/SpaceAfterColon
- Layout/SpaceAfterComma
- Layout/SpaceAfterNot
- Layout/SpaceAroundBlockParameters
- Layout/SpaceAroundKeyword
- Layout/SpaceAroundOperators
- Layout/SpaceBeforeBlockBraces
- Layout/SpaceBeforeComma
- Layout/SpaceBeforeFirstArg
- Layout/SpaceInsideArrayLiteralBrackets
- Layout/SpaceInsideBlockBraces
- Layout/SpaceInsideHashLiteralBraces
- Layout/SpaceInsideParens
- Layout/TrailingEmptyLines
- Layout/TrailingWhitespace
- Lint/AmbiguousBlockAssociation
- Lint/AmbiguousOperatorPrecedence
- Lint/BooleanSymbol
- Lint/DeprecatedClassMethods
- Lint/EmptyConditionalBody
- Lint/RedundantStringCoercion
- Lint/RedundantWithIndex
- Lint/SafeNavigationChain
- Lint/SafeNavigationConsistency
- Lint/ShadowingOuterLocalVariable
- Lint/SymbolConversion
- Lint/Syntax
- Lint/UnexpectedBlockArity
- Lint/UnusedBlockArgument
- Lint/UselessAssignment
- Lint/Void
- Naming/VariableName
- Performance/Casecmp
- Performance/CollectionLiteralInLoop
- Performance/MapCompact
- Performance/RegexpMatch
- Performance/Squeeze
- Performance/StringIdentifierArgument
- Performance/StringReplacement
- Rails/Blank
- Rails/ContentTag
- Rails/LinkToBlank
- Rails/OutputSafety
- Rails/Presence
- Rails/Present
- Rails/RenderInline
- Rails/WhereExists
- RailsAccessibility/ImageHasAlt
- Style/CaseEquality
- Style/CaseLikeIf
- Style/ConditionalAssignment
- Style/EachForSimpleLoop
- Style/EvenOdd
- Style/For
- Style/HashSyntax
- Style/MethodCallWithoutArgsParentheses
- Style/MultipleComparison
- Style/NegatedIf
- Style/NegatedIfElseCondition
- Style/NestedTernaryOperator
- Style/Next
- Style/NilComparison
- Style/NonNilCheck
- Style/ParenthesesAroundCondition
- Style/PreferredHashMethods
- Style/QuotedSymbols
- Style/RedundantConstantBase
- Style/RedundantFreeze
- Style/RedundantInterpolation
- Style/RedundantStringEscape
- Style/SafeNavigation
- Style/SelfAssignment
- Style/Semicolon
- Style/SlicingWithRange
- Style/SoleNestedConditional
- Style/StringLiteralsInInterpolation
- Style/SymbolLiteral
- Style/SymbolProc
- Style/UnlessElse
- Style/WordArray
- Style/YodaCondition
- Style/ZeroLengthPredicate
exclude:
- '/**/pegasus/test/fixtures/**/*.haml'
- 'pegasus/test/fixtures/**/*.haml'
require:
- './tools/customLinters/haml_lint_only_allowed_characters.rb'