Skip to content

Commit

Permalink
chore: add erblint (#2794)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianthedev authored May 22, 2024
1 parent 70ac026 commit 9e74b75
Show file tree
Hide file tree
Showing 19 changed files with 132 additions and 35 deletions.
12 changes: 12 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
EnableDefaultLinters: true
linters:
Rubocop:
enabled: true
rubocop_config:
require: standard
inherit_gem:
standard: config/base.yml
inherit_from: .erb-lint_rubocop.yml
AllCops:
DisabledByDefault: true
8 changes: 8 additions & 0 deletions .erb-lint_rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Layout/TrailingEmptyLines:
Enabled: false

Layout/InitialIndentation:
Enabled: false

Lint/UselessAssignment:
Enabled: false
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gem 'cssbundling-rails'
#
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 7.1.0"
# gem 'rails', github: 'rails/rails'

# Use postgresql as the database for Active Record
gem "pg", ">= 0.18", "< 2.0"
Expand Down Expand Up @@ -102,6 +103,8 @@ group :development, :test do
gem "faker", require: false
gem "i18n-tasks", "~> 1.0.12"
gem "erb-formatter"
# https://thoughtbot.com/blog/a-standard-way-to-lint-your-views
gem "erb_lint"
gem "solargraph"
gem "solargraph-rails"

Expand Down Expand Up @@ -139,6 +142,7 @@ gem "active_median"
gem 'acts_as_list'

gem 'acts-as-taggable-on', '~> 10.0'
# gem 'acts-as-taggable-on', github: 'avo-hq/acts-as-taggable-on'

gem "bundler-integrity", "~> 1.0"

Expand All @@ -150,6 +154,7 @@ gem "chartkick"

# Avo file filed requires this gem
gem "activestorage"
# gem "activestorage", github: "rails/rails", branch: "main"
# Required by Avo
gem "sprockets-rails"

Expand Down
39 changes: 21 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ GEM
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.1.8)
bigdecimal (3.1.7)
bindex (0.8.1)
bootsnap (1.18.3)
msgpack (~> 1.2)
Expand Down Expand Up @@ -184,7 +184,6 @@ GEM
crass (1.0.6)
cssbundling-rails (1.4.0)
railties (>= 6.0.0)
csv (3.3.0)
cuprite (0.15)
capybara (~> 3.0)
ferrum (~> 0.14.0)
Expand Down Expand Up @@ -238,6 +237,13 @@ GEM
e2mmap (0.1.0)
erb-formatter (0.7.1)
syntax_tree (~> 6.0)
erb_lint (0.5.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop
smart_properties
erubi (1.12.0)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -281,11 +287,10 @@ GEM
listen (>= 3.0.0)
railties (>= 6.0.0)
htmlbeautifier (1.4.2)
httparty (0.22.0)
csv
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
i18n (1.14.5)
i18n (1.14.4)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.13)
activesupport (>= 4.0.2)
Expand All @@ -306,8 +311,8 @@ GEM
activesupport (>= 3.0)
nokogiri (>= 1.6)
io-console (0.7.2)
irb (1.13.1)
rdoc (>= 4.0.0)
irb (1.12.0)
rdoc
reline (>= 0.4.2)
iso (0.4.0)
i18n
Expand Down Expand Up @@ -338,9 +343,9 @@ GEM
mapkick-rb (0.1.5)
marcel (1.0.2)
matrix (0.4.2)
meta-tags (2.21.0)
meta-tags (2.20.0)
actionpack (>= 6.0.0, < 7.2)
method_source (1.1.0)
method_source (1.0.0)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.6)
Expand All @@ -355,8 +360,7 @@ GEM
money (~> 6.13)
railties (>= 3.0)
msgpack (1.7.2)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
multi_xml (0.6.0)
mutex_m (0.2.0)
net-imap (0.4.10)
date
Expand Down Expand Up @@ -387,7 +391,7 @@ GEM
prettier_print (1.2.1)
psych (5.1.2)
stringio
public_suffix (5.0.5)
public_suffix (5.0.4)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
Expand Down Expand Up @@ -457,15 +461,14 @@ GEM
rainbow (>= 2.0, < 4.0)
rexml (~> 3.1)
regexp_parser (2.9.0)
reline (0.5.6)
reline (0.5.1)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.8)
strscan (>= 3.0.9)
rexml (3.2.6)
ripper-tags (1.0.1)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
Expand Down Expand Up @@ -576,7 +579,6 @@ GEM
lint_roller (~> 1.1)
rubocop-performance (~> 1.20.2)
stringio (3.1.0)
strscan (3.1.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
terminal-table (3.0.2)
Expand All @@ -587,7 +589,7 @@ GEM
tilt (2.3.0)
timeout (0.4.1)
tty-which (0.5.0)
turbo-rails (2.0.5)
turbo-rails (2.0.1)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
railties (>= 6.0.0)
Expand All @@ -597,7 +599,7 @@ GEM
concurrent-ruby (~> 1.0)
unaccent (0.4.0)
unicode-display_width (2.5.0)
view_component (3.12.1)
view_component (3.10.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
Expand Down Expand Up @@ -656,6 +658,7 @@ DEPENDENCIES
devise
dotenv-rails
erb-formatter
erb_lint
factory_bot_rails
faker
friendly_id (~> 5.5.1)
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_6.1_ruby_3.1.4.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ gem "pluggy", path: "../pluggy"
gem "money-rails", "~> 1.12"
gem "avo-money_field"
gem "avo-record_link_field"
gem "pagy", "> 8"
gem "psych", "< 4"

group :development do
Expand Down Expand Up @@ -80,6 +81,7 @@ group :development, :test do
gem "faker", require: false
gem "i18n-tasks", "~> 1.0.12"
gem "erb-formatter"
gem "erb_lint"
gem "solargraph"
gem "solargraph-rails"
gem "factory_bot_rails"
Expand Down
11 changes: 10 additions & 1 deletion gemfiles/rails_6.1_ruby_3.1.4.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ GEM
e2mmap (0.1.0)
erb-formatter (0.7.1)
syntax_tree (~> 6.0)
erb_lint (0.5.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop
smart_properties
erubi (1.12.0)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -347,7 +354,7 @@ GEM
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
pagy (7.0.6)
pagy (8.4.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
Expand Down Expand Up @@ -616,6 +623,7 @@ DEPENDENCIES
devise
dotenv-rails
erb-formatter
erb_lint
factory_bot_rails
faker
friendly_id (~> 5.5.1)
Expand All @@ -636,6 +644,7 @@ DEPENDENCIES
meta-tags
money-rails (~> 1.12)
net-smtp
pagy (> 8)
pg (>= 0.18, < 2.0)
pluggy!
prefixed_ids
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_6.1_ruby_3.2.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ gem "pluggy", path: "../pluggy"
gem "money-rails", "~> 1.12"
gem "avo-money_field"
gem "avo-record_link_field"
gem "pagy", "> 8"
gem "psych", "< 4"

group :development do
Expand Down Expand Up @@ -80,6 +81,7 @@ group :development, :test do
gem "faker", require: false
gem "i18n-tasks", "~> 1.0.12"
gem "erb-formatter"
gem "erb_lint"
gem "solargraph"
gem "solargraph-rails"
gem "factory_bot_rails"
Expand Down
11 changes: 10 additions & 1 deletion gemfiles/rails_6.1_ruby_3.2.2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ GEM
e2mmap (0.1.0)
erb-formatter (0.7.1)
syntax_tree (~> 6.0)
erb_lint (0.5.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop
smart_properties
erubi (1.12.0)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -347,7 +354,7 @@ GEM
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
pagy (7.0.6)
pagy (8.4.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
Expand Down Expand Up @@ -616,6 +623,7 @@ DEPENDENCIES
devise
dotenv-rails
erb-formatter
erb_lint
factory_bot_rails
faker
friendly_id (~> 5.5.1)
Expand All @@ -636,6 +644,7 @@ DEPENDENCIES
meta-tags
money-rails (~> 1.12)
net-smtp
pagy (> 8)
pg (>= 0.18, < 2.0)
pluggy!
prefixed_ids
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_6.1_ruby_3.3.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ gem "pluggy", path: "../pluggy"
gem "money-rails", "~> 1.12"
gem "avo-money_field"
gem "avo-record_link_field"
gem "pagy", "> 8"
gem "psych", "< 4"

group :development do
Expand Down Expand Up @@ -80,6 +81,7 @@ group :development, :test do
gem "faker", require: false
gem "i18n-tasks", "~> 1.0.12"
gem "erb-formatter"
gem "erb_lint"
gem "solargraph"
gem "solargraph-rails"
gem "factory_bot_rails"
Expand Down
11 changes: 10 additions & 1 deletion gemfiles/rails_6.1_ruby_3.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ GEM
e2mmap (0.1.0)
erb-formatter (0.7.1)
syntax_tree (~> 6.0)
erb_lint (0.5.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop
smart_properties
erubi (1.12.0)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -347,7 +354,7 @@ GEM
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
pagy (7.0.6)
pagy (8.4.0)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
Expand Down Expand Up @@ -616,6 +623,7 @@ DEPENDENCIES
devise
dotenv-rails
erb-formatter
erb_lint
factory_bot_rails
faker
friendly_id (~> 5.5.1)
Expand All @@ -636,6 +644,7 @@ DEPENDENCIES
meta-tags
money-rails (~> 1.12)
net-smtp
pagy (> 8)
pg (>= 0.18, < 2.0)
pluggy!
prefixed_ids
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_7.1_ruby_3.1.4.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ gem "pluggy", path: "../pluggy"
gem "money-rails", "~> 1.12"
gem "avo-money_field"
gem "avo-record_link_field"
gem "pagy", "> 8"
gem "psych", "< 4"

group :development do
Expand Down Expand Up @@ -80,6 +81,7 @@ group :development, :test do
gem "faker", require: false
gem "i18n-tasks", "~> 1.0.12"
gem "erb-formatter"
gem "erb_lint"
gem "solargraph"
gem "solargraph-rails"
gem "factory_bot_rails"
Expand Down
Loading

0 comments on commit 9e74b75

Please sign in to comment.