Added haml-lint and fix warnings (#2773)

* add haml_lint to Gemfile

* add .haml-lint.yml

* fix warnings of haml_lint
This commit is contained in:
yhirano 2017-05-08 10:35:25 +09:00 committed by Eugen Rochko
parent b18504adfe
commit 48594b18e6
39 changed files with 207 additions and 90 deletions

108
.haml-lint.yml Normal file
View file

@ -0,0 +1,108 @@
# Whether to ignore frontmatter at the beginning of HAML documents for
# frameworks such as Jekyll/Middleman
skip_frontmatter: false
exclude:
- 'vendor/**/*'
- 'spec/**/*'
- 'lib/templates/**/*'
- 'app/views/kaminari/**/*'
linters:
AltText:
enabled: false
ClassAttributeWithStaticValue:
enabled: true
ClassesBeforeIds:
enabled: true
ConsecutiveComments:
enabled: true
ConsecutiveSilentScripts:
enabled: true
max_consecutive: 2
EmptyObjectReference:
enabled: true
EmptyScript:
enabled: true
FinalNewline:
enabled: true
present: true
HtmlAttributes:
enabled: true
ImplicitDiv:
enabled: true
LeadingCommentSpace:
enabled: true
LineLength:
enabled: false
max: 80
MultilinePipe:
enabled: true
MultilineScript:
enabled: true
ObjectReferenceAttributes:
enabled: true
RuboCop:
enabled: true
# These cops are incredibly noisy when it comes to HAML templates, so we
# ignore them.
ignored_cops:
- Lint/BlockAlignment
- Lint/EndAlignment
- Lint/Void
- Metrics/BlockLength
- Metrics/LineLength
- Style/AlignParameters
- Style/BlockNesting
- Style/ElseAlignment
- Style/EndOfLine
- Style/FileName
- Style/FinalNewline
- Style/FrozenStringLiteralComment
- Style/IfUnlessModifier
- Style/IndentationWidth
- Style/Next
- Style/TrailingBlankLines
- Style/TrailingWhitespace
- Style/WhileUntilModifier
RubyComments:
enabled: true
SpaceBeforeScript:
enabled: true
SpaceInsideHashAttributes:
enabled: true
style: space
Indentation:
enabled: true
character: space # or tab
TagName:
enabled: true
TrailingWhitespace:
enabled: true
UnnecessaryInterpolation:
enabled: true
UnnecessaryStringOutput:
enabled: true

View file

@ -89,6 +89,7 @@ group :development do
gem 'brakeman', '~> 3.6.0', require: false
gem 'bundler-audit', '~> 0.4.0', require: false
gem 'scss_lint', '0.42.2', require: false
gem 'haml_lint', '~> 0.19.0', require: false
gem 'capistrano', '3.8.0'
gem 'capistrano-rails'

View file

@ -157,6 +157,13 @@ GEM
addressable (~> 2.4)
http (~> 2.0)
nokogiri (~> 1.6)
haml (4.0.7)
tilt
haml_lint (0.19.0)
haml (~> 4.0)
rake (>= 10, < 13)
rubocop (>= 0.36.0)
sysexits (~> 1.1)
hamlit (2.8.1)
temple (>= 0.8.0)
thor
@ -431,6 +438,7 @@ GEM
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
statsd-instrument (2.1.2)
sysexits (1.2.0)
temple (0.8.0)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
@ -495,6 +503,7 @@ DEPENDENCIES
fast_blank
fuubar
goldfinger
haml_lint (~> 0.19.0)
hamlit-rails
hiredis
htmlentities

View file

Internal server error - The gay git

500

Internal server error

Forgejo version: 9.0.3

@ -7,7 +7,7 @@