diff --git a/.erb-lint.yml b/.erb-lint.yml new file mode 100644 index 000000000..895a9d799 --- /dev/null +++ b/.erb-lint.yml @@ -0,0 +1,14 @@ +--- +linters: + FinalNewline: + enabled: true + SpaceAroundErbTag: + enabled: true + SelfClosingTag: + enabled: false + Rubocop: + enabled: true + only: + - Layout/EndOfLine + - Lint/LiteralAsCondition + - Style/PercentLiteralDelimiters diff --git a/.hound.yml b/.hound.yml index b311fe432..4e54eebfc 100644 --- a/.hound.yml +++ b/.hound.yml @@ -4,3 +4,6 @@ scss: config_file: .scss-lint.yml coffeescript: config_file: .coffeelint.json +erblint: + enabled: true + config_file: .erb-lint.yml diff --git a/Gemfile b/Gemfile index 318f0a2ce..c44b24cc9 100644 --- a/Gemfile +++ b/Gemfile @@ -89,6 +89,7 @@ group :development do gem "capistrano-bundler", "~> 1.2", require: false gem "capistrano-rails", "~> 1.4.0", require: false gem "capistrano3-delayed-job", "~> 1.7.3" + gem "erb_lint", require: false gem "mdl", "~> 0.5.0", require: false gem "rubocop", "~> 0.54.0", require: false gem "rubocop-rspec", "~> 1.26.0", require: false diff --git a/Gemfile.lock b/Gemfile.lock index fa0768814..07fdf7c89 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,6 +68,14 @@ GEM babel-source (>= 4.0, < 6) execjs (~> 2.0) bcrypt (3.1.11) + better_html (1.0.13) + actionview (>= 4.0) + activesupport (>= 4.0) + ast (~> 2.0) + erubi (~> 1.4) + html_tokenizer (~> 0.0.6) + parser (>= 2.4) + smart_properties browser (2.5.3) builder (3.2.3) bullet (5.7.1) @@ -148,6 +156,13 @@ GEM htmlentities (~> 4.3.3) launchy (~> 2.1) mail (~> 2.6) + erb_lint (0.0.28) + activesupport + better_html (~> 1.0.7) + html_tokenizer + rainbow + rubocop (~> 0.51) + smart_properties errbase (0.0.3) erubi (1.7.1) erubis (2.7.0) @@ -189,6 +204,7 @@ GEM builder (>= 2.1.2) hashie (3.5.7) highline (2.0.0) + html_tokenizer (0.0.7) htmlentities (4.3.4) httpi (2.4.4) rack @@ -428,6 +444,7 @@ GEM simplecov-html (0.10.2) sitemap_generator (6.0.1) builder (~> 3.0) + smart_properties (1.13.1) social-share-button (1.1.0) coffee-rails socksify (1.7.1) @@ -520,6 +537,7 @@ DEPENDENCIES devise-async (~> 0.10.2) devise_security_extension (~> 0.10.0) email_spec (~> 2.1.0) + erb_lint factory_bot_rails (~> 4.8.2) faker (~> 1.8.7) foundation-rails (~> 6.4.3.0)