Commit e6c70fa
Changed files (4)
lib/tasks/lint.rake
@@ -23,8 +23,11 @@ namespace :lint do
end
desc "run uilinters"
- task(:uilint) { sh 'yarn lint' }
+ task(:ui) { sh 'yarn lint' }
+
+ desc "run erb linter"
+ task(:erb) { sh 'erblint --lint-all --enable-all-linters' }
desc "Run linters to check the quality of the code."
- task all: [:rubocop, 'bundle:audit', :brakeman, :uilint]
+ task all: ['bundle:audit', :brakeman, :erb, :rubocop, :ui]
end
.erb-lint.yml
@@ -0,0 +1,29 @@
+---
+exclude:
+ - "*/doc/_includes*"
+ - "*/pkg/*"
+ - "*/vendor/bundle*"
+linters:
+ ErbSafety:
+ enabled: true
+ 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
Gemfile
@@ -32,6 +32,7 @@ end
group :development do
gem 'brakeman', '~> 4.3'
gem 'bundler-audit', '~> 0.6'
+ gem 'erb_lint', require: false
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'rubocop', '~> 0.59', require: false
gem 'web-console', '>= 3.3.0'
Gemfile.lock
@@ -55,6 +55,14 @@ GEM
audited (4.8.0)
activerecord (>= 4.0, < 5.3)
bcrypt (3.1.12)
+ 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
bindex (0.5.0)
bootsnap (1.3.2)
msgpack (~> 1.0)
@@ -89,6 +97,13 @@ GEM
http_parser.rb (~> 0.6.0)
email_validator (1.6.0)
activemodel
+ erb_lint (0.0.28)
+ activesupport
+ better_html (~> 1.0.7)
+ html_tokenizer
+ rainbow
+ rubocop (~> 0.51)
+ smart_properties
erubi (1.7.1)
eventmachine (1.2.7)
factory_bot (4.11.1)
@@ -107,6 +122,7 @@ GEM
activesupport (>= 4.2.0)
hashdiff (0.3.7)
highline (2.0.0)
+ html_tokenizer (0.0.7)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
@@ -277,6 +293,7 @@ GEM
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2, >= 1.2.2)
+ smart_properties (1.13.1)
spank (1.0.1441140881)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
@@ -339,6 +356,7 @@ DEPENDENCIES
capybara-screenshot (~> 1.0)
dotenv (~> 2.5)
email_validator (~> 1.6)
+ erb_lint
factory_bot_rails (~> 4.11)
ffaker (~> 2.10)
flipper (~> 0.16)