Skip to content

Enable HAML-LINT linters

Similar to #17478 (closed), following is a list of HAML-LINT offenses:

11 AltText
20 ClassAttributeWithStaticValue
54 ClassesBeforeIds
7 ConsecutiveComments
32 ConsecutiveSilentScripts
0 EmptyObjectReference
0 EmptyScript
5 FinalNewline
8 HtmlAttributes
36 ImplicitDiv
0 Indentation
14 LeadingCommentSpace
2037 LineLength
3 MultilinePipe
0 MultilineScript
0 ObjectReferenceAttributes
538 RuboCop
13 RubyComments
14 SpaceBeforeScript
715 SpaceInsideHashAttributes
0 TagName
12 TrailingWhitespace
56 UnnecessaryInterpolation
31 UnnecessaryStringOutput

Command used to extract those offenses:

for cop in `haml-lint --show-linters | egrep -o "^ - \w+$" | sed 's/ - //'`; do if ! grep -q $cop ok_cops; then echo `haml-lint --include-linter $cop . | grep $cop | wc -l` $cop >> bad_cops; fi; done

Update

Phase 1

We enabled following linters in first phase, see !8247 (merged).

AltText
ClassAttributeWithStaticValue
FinalNewline
HtmlAttributes
ImplicitDiv
SpaceBeforeScript
SpaceInsideHashAttributes
TrailingWhitespace
Phase 2

For second phase, we've decided to enable following.

UnnecessaryInterpolation
UnnecessaryStringOutput
RubyComments
MultilinePipe

/cc @grzesiek @rspeicher