Skip to content

Instantly share code, notes, and snippets.

@ZeroPivot
Forked from dsandstrom/.rubocop.yml
Last active September 30, 2021 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeroPivot/93b4e254b97ec7b9e683a695baec7e51 to your computer and use it in GitHub Desktop.
Save ZeroPivot/93b4e254b97ec7b9e683a695baec7e51 to your computer and use it in GitHub Desktop.
Rubocop config files for Ruby 3.0 / Rails 6+
# .rubocop.yml
# rubocop config files for Ruby 3.0 / Rails 6+ project
AllCops:
TargetRubyVersion: 3.0
NewCops: enable
SuggestExtensions: true
Include:
- 'config.ru'
- 'Gemfile'
- 'Guardfile'
- 'Rakefile'
- 'app/**/*.rb'
- 'config/**/*.rb'
- 'lib/**/*.rb'
- 'spec/**/*.rb'
- 'db/seeds.rb'
Exclude:
- 'bin/*'
- 'db/schema.rb'
- 'db/migrate/*'
- 'log/**/*'
- 'node_modules/**/*'
- 'public/**/*'
- 'script/**/*'
- 'vendor/**/*'
- 'tmp/**/*'
- '.git/**/*'
- 'app/views/**/*'
Layout/IndentationConsistency:
EnforcedStyle: 'indented_internal_methods'
Layout/LineLength:
Max: 80
Metrics/BlockLength:
Exclude:
- 'Guardfile'
- 'config/environments/*'
Metrics/ClassLength:
Exclude:
- 'db/seeds.rb'
Max: 150
Metrics/ModuleLength:
Max: 150
Naming/FileName:
Exclude:
- 'Gemfile'
- 'Guardfile'
- 'Rakefile'
Style/Documentation:
Enabled: false
Style/StringLiterals:
Enabled: true
EnforcedStyle: single_quotes
# spec/.rubocop.yml
inherit_from:
- ../.rubocop.yml
StringLiterals:
EnforcedStyle: double_quotes
Exclude:
- './*_helper.rb'
# describe block
Metrics/BlockLength:
Enabled: false
# spec/fabricators/.rubocop.yml
inherit_from:
- ../../.rubocop.yml
# spec/support/.rubocop.yml
inherit_from:
- ../../.rubocop.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment