Skip to content

Instantly share code, notes, and snippets.

@valdemarua
Last active December 23, 2023 13:28
Show Gist options
  • Save valdemarua/9126bcf89ed78783d9c0a86b0185000d to your computer and use it in GitHub Desktop.
Save valdemarua/9126bcf89ed78783d9c0a86b0185000d to your computer and use it in GitHub Desktop.
Rubocop + Standardrb + Rubocop Rspec
# .rubocop-rails.yml
# .rubocop-rspec.yml
RSpec/ExampleLength:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
# .rubocop.yml
inherit_mode:
merge:
- Exclude
require:
- rubocop-rails
- rubocop-rspec
- rubocop-performance
- standard/cop/block_single_line_braces
inherit_gem:
standard: config/base.yml
inherit_from:
- .rubocop_rails.yml
- .rubocop_rspec.yml
# Standardrb overrides
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Enabled: true
Style/TrailingCommaInHashLiteral:
Description: 'Checks for trailing comma in hash literals.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Enabled: true
Style/TrailingCommaInArrayLiteral:
Description: 'Checks for trailing comma in array literals.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
EnforcedStyleForMultiline: comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Enabled: true
source "https://rubygems.org"
#
# touch .rubocop.yml .rubocop-rspec.yml .rubocop-rails.yml
#
# Add gems to your Gemfile
group :development, :test do
gem "rubocop-rails"
gem "rubocop-rspec"
gem "rubocop-performance"
gem "standard", "~> 1.3"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment