Skip to content

Instantly share code, notes, and snippets.

@AlyBadawy
Last active January 3, 2025 14:48
Show Gist options
  • Save AlyBadawy/405440ea14f3f265367a38f06a5c3c67 to your computer and use it in GitHub Desktop.
Save AlyBadawy/405440ea14f3f265367a38f06a5c3c67 to your computer and use it in GitHub Desktop.
AllCops:
NewCops: enable
Exclude:
- bin/yarn
- db/schema.rb
- vendor/**/*
- node_modules/**/*
- tmp/**/*
- public/**/*
- bin/**/*
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
inherit_gem:
rubocop-config-prettier: config/rubocop.yml
#################### Bundler ###############################
Bundler/DuplicatedGem:
Enabled: true
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
Bundler/GemComment:
Enabled: false
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
IgnoredGems: []
OnlyFor: []
Bundler/GemFilename:
Enabled: true
EnforcedStyle: 'Gemfile'
Include:
- '**/Gemfile'
- '**/gems.rb'
- '**/Gemfile.lock'
- '**/gems.locked'
Bundler/GemVersion:
Enabled: false
EnforcedStyle: 'required'
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
AllowedGems: []
Bundler/OrderedGems:
Enabled: true
TreatCommentsAsGroupSeparators: true
ConsiderPunctuation: false
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
#################### Layout ###########################
Layout/AccessModifierIndentation:
Enabled: true
EnforcedStyle: indent
Layout/ArgumentAlignment:
Enabled: true
EnforcedStyle: with_first_argument
Layout/ArrayAlignment:
Enabled: true
EnforcedStyle: with_first_element
Layout/CaseIndentation:
Enabled: true
EnforcedStyle: case
IndentOneStep: false
Layout/ClassStructure:
Enabled: true
Categories:
module_inclusion:
- include
- prepend
- extend
ExpectedOrder:
- module_inclusion
- constants
- public_class_methods
- initializer
- public_methods
- protected_methods
- private_methods
Layout/CommentIndentation:
Enabled: true
AllowForAlignment: true
Layout/DotPosition:
Enabled: true
EnforcedStyle: leading
Layout/EmptyLineBetweenDefs:
Enabled: true
EmptyLineBetweenMethodDefs: true
EmptyLineBetweenClassDefs: true
EmptyLineBetweenModuleDefs: true
AllowAdjacentOneLineDefs: true
NumberOfEmptyLines: 1
Layout/EmptyLinesAroundAccessModifier:
Enabled: true
EnforcedStyle: around
Layout/HashAlignment:
Enabled: true
AllowMultipleStyles: true
EnforcedHashRocketStyle: key
EnforcedColonStyle: key
Layout/IndentationStyle:
Enabled: true
EnforcedStyle: spaces
Layout/IndentationWidth:
Width: 2
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
###################### Lint ###########################
Lint/Debugger:
Enabled: true
Severity: error
#################### Metrics ##########################
Metrics/AbcSize:
Max: 50
Metrics/BlockLength:
CountComments: false
Max: 50
AllowedMethods:
- context
- describe
- it
- shared_examples
- shared_examples_for
- namespace
- draw
- configure
- group
Exclude:
- config/routes.rb
- config/seeds.rb
Metrics/ClassLength:
Enabled: true
Max: 200
Metrics/ModuleLength:
Enabled: true
Max: 250
Metrics/MethodLength:
Enabled: true
Max: 20
Exclude:
- 'db/migrate/*.rb'
Rails:
Enabled: true # enable rubocop-rails cops
Rails/ApplicationController:
Enabled: true
Exclude:
- app/controllers/react_controller.rb
Rails/FilePath:
Enabled: false
Rails/ResponseParsedBody:
Enabled: false
RSpec:
Enabled: true # enable rubocop-rspec cops
RSpec/DescribeClass:
Enabled: false # ignore missing comments on classes
RSpec/ExampleLength:
Enabled: true
Max: 25
RSpec/FilePath:
Enabled: true
Exclude:
- spec/helpers/react
RSpec/HookArgument:
Enabled: false
RSpec/InstanceVariable:
Enabled: false
RSpec/NestedGroups:
Enabled: true
Max: 5
RSpec/MultipleExpectations:
Enabled: true
Max: 5
Style/Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Style/QuotedSymbols:
Enabled: true
EnforcedStyle: single_quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment