🧹 Linting and Formatting Code Setup
🔍 Rubocop (Ruby Linter)
✏️ Add Gems to Gemfile
# under :development, :test group `group :development, :test do`
gem "rubocop", require: false
gem "rubocop-rails", require: false
📦 Install
bundle install
⚙️ Add Config
curl -o ".rubocop.yml" "<https://raw.githubusercontent.com/bigbinary/wheel/main/.rubocop.yml>"
🧪 Run Rubocop
bundle exec rubocop
bundle exec rubocop -a
🧼 ERB Lint
➕ Add Gem to Gemfile
# under :development group
gem "erb_lint", require: false, git: "<https://github.com/Shopify/erb-lint.git>", branch: "main"
📦 Install
bundle install
⚙️ Add Config
touch .erb-lint.yml
---
exclude:
- "app/views/shared/_bundle.html.erb"