Introduce erb-lint for linting erb files

This also allows running rubocop on the ruby code within the erb
files.
This commit is contained in:
Andy Allan 2019-03-06 11:30:40 +01:00 committed by Tom Hughes
parent 4dd0a74a3b
commit d6a2515cb0
3 changed files with 74 additions and 0 deletions

55
.erb-lint.yml Normal file
View file

@ -0,0 +1,55 @@
---
linters:
SelfClosingTag:
enabled: false
SpaceInHtmlTag:
enabled: false # TODO
Rubocop:
enabled: true
rubocop_config:
inherit_from:
- .rubocop.yml
Layout/InitialIndentation:
Enabled: false
Layout/TrailingBlankLines:
Enabled: false
Layout/TrailingWhitespace:
Enabled: false
Naming/FileName:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Metrics/LineLength:
Enabled: false
Lint/UselessAssignment:
Enabled: false
Rails/OutputSafety:
Enabled: false
Style/StringLiterals:
Enabled: false # TODO
Style/BracesAroundHashParameters:
Enabled: false # TODO
Rails/DynamicFindBy:
Enabled: false # TODO
Style/AndOr:
Enabled: false # TODO
Style/WordArray:
Enabled: false # TODO
Style/MethodCallWithoutArgsParentheses:
Enabled: false # TODO
Layout/LeadingBlankLines:
Enabled: false # TODO
Style/NestedParenthesizedCalls:
Enabled: false # TODO
Rails/LinkToBlank:
Enabled: false # TODO
Style/HashSyntax:
Enabled: false # TODO
Style/SymbolProc:
Enabled: false # TODO
Style/Not:
Enabled: false # TODO
Style/NegatedIf:
Enabled: false # TODO
Style/ConditionalAssignment:
Enabled: false # TODO

View file

@ -144,6 +144,7 @@ end
group :development, :test do
gem "capybara", "~> 2.13"
gem "coveralls", :require => false
gem "erb_lint", :require => false
gem "factory_bot_rails"
gem "jshint"
gem "poltergeist"

View file

@ -64,6 +64,14 @@ GEM
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
better_html (1.0.11)
actionview (>= 4.0)
activesupport (>= 4.0)
ast (~> 2.0)
erubi (~> 1.4)
html_tokenizer (~> 0.0.6)
parser (>= 2.4)
smart_properties
bigdecimal (1.1.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
@ -145,6 +153,13 @@ GEM
dry-logic (~> 0.5, >= 0.5.0)
dry-types (~> 0.14, >= 0.14)
dynamic_form (1.1.4)
erb_lint (0.0.28)
activesupport
better_html (~> 1.0.7)
html_tokenizer
rainbow
rubocop (~> 0.51)
smart_properties
erubi (1.8.0)
execjs (2.7.0)
exifr (1.3.6)
@ -165,6 +180,7 @@ GEM
activesupport (>= 4.2.0)
hashdiff (0.3.8)
hashie (3.6.0)
html_tokenizer (0.0.7)
htmlentities (4.3.4)
http_accept_language (2.0.5)
i18n (0.9.5)
@ -381,6 +397,7 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
smart_properties (1.13.1)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@ -443,6 +460,7 @@ DEPENDENCIES
dalli
delayed_job_active_record
dynamic_form
erb_lint
factory_bot_rails
fakefs
faraday