Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .erb_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
glob: "**/*.{html,text,js}{+*,}.erb"
EnableDefaultLinters: true
linters:
ErbSafety:
enabled: true
Rubocop:
enabled: true
rubocop_config:
inherit_from:
- .rubocop.yml
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
- name: Lint code for consistent style
run: bin/rubocop -f github

- name: Lint ERB templates
run: bundle exec erb_lint .

test:
runs-on: ubuntu-latest

Expand Down
8 changes: 3 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Omakase Ruby styling for Rails
inherit_gem: { rubocop-rails-omakase: rubocop.yml }

# Overwrite or add rules to create your own house style
#
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
# Layout/SpaceInsideArrayLiteralBrackets:
# Enabled: false
AllCops:
Exclude:
- 'app/views/**/*.{html,erb}'
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ end
group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"

# linters
gem "erb_lint"
gem "rubocop", require: false
gem "rubocop-rails", require: false
gem "rubocop-rspec", require: false
end

group :test do
Expand Down
21 changes: 21 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ GEM
bcrypt_pbkdf (1.1.1-arm64-darwin)
bcrypt_pbkdf (1.1.1-x86_64-darwin)
benchmark (0.4.0)
better_html (2.1.1)
actionview (>= 6.0)
activesupport (>= 6.0)
ast (~> 2.0)
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.1.8)
bindex (0.8.1)
bootsnap (1.18.4)
Expand Down Expand Up @@ -113,6 +120,13 @@ GEM
dotenv (3.1.7)
drb (2.2.1)
ed25519 (1.3.0)
erb_lint (0.7.0)
activesupport
better_html (>= 2.0.1)
parser (>= 2.7.1.4)
rainbow
rubocop (>= 1)
smart_properties
erubi (1.13.1)
et-orbi (1.2.11)
tzinfo
Expand Down Expand Up @@ -300,6 +314,8 @@ GEM
rubocop-minitest
rubocop-performance
rubocop-rails
rubocop-rspec (3.3.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
securerandom (0.4.1)
Expand All @@ -309,6 +325,7 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
smart_properties (1.17.0)
solid_cable (3.0.5)
actioncable (>= 7.2)
activejob (>= 7.2)
Expand Down Expand Up @@ -405,6 +422,7 @@ DEPENDENCIES
capybara
database_cleaner
debug
erb_lint
factory_bot_rails
importmap-rails
jbuilder
Expand All @@ -413,7 +431,10 @@ DEPENDENCIES
puma (>= 5.0)
rails (~> 8.0.1)
rspec-rails
rubocop
rubocop-rails
rubocop-rails-omakase
rubocop-rspec
selenium-webdriver
solid_cable
solid_cache
Expand Down
Loading