Skip to content

Commit

Permalink
Refactor RuboCop configs and restructure setup
Browse files Browse the repository at this point in the history
Deleted `rubocop.yml` and split configurations into `rubocop-gem.yml` and `rubocop-rails.yml`. Updated `.rubocop.yml` to inherit from `rubocop-gem.yml` for better organization and clarity. This change enhances modularity and maintainability of linting rules.
  • Loading branch information
co-anton-s committed Nov 2, 2024
1 parent b20f4a1 commit 1202d45
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
inherit_gem: { servactory-rubocop: rubocop.yml }
inherit_gem: { servactory-rubocop: rubocop-gem.yml }
1 change: 0 additions & 1 deletion rubocop.yml → rubocop-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ inherit_mode:
- Exclude

AllCops:
DisabledByDefault: true
NewCops: enable

Style/HashSyntax:
Expand Down
64 changes: 64 additions & 0 deletions rubocop-rails.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
require:
- rubocop-factory_bot
- rubocop-performance
- rubocop-rails
- rubocop-rake
- rubocop-rspec
- rubocop-rspec_rails

inherit_mode:
merge:
- Exclude

AllCops:
NewCops: enable

################################################################################

Style/ClassAndModuleChildren:
EnforcedStyle: compact
Exclude:
- config/application.rb

Style/Documentation:
Enabled: false

Style/HashSyntax:
EnforcedShorthandSyntax: always

Style/StringLiterals:
EnforcedStyle: double_quotes

################################################################################

Rails/Output:
Exclude:
- db/**/*.rb

################################################################################

RSpec/EmptyExampleGroup:
Exclude:
- spec/requests/**/*.rb

RSpec/ExampleLength:
Max: 20

RSpec/MultipleMemoizedHelpers:
Max: 16

RSpec/NamedSubject:
EnforcedStyle: named_only

RSpec/NestedGroups:
Max: 10

RSpec/SpecFilePathFormat:
Include:
- "spec/**/*_spec.rb"
Exclude:
- "spec/requests/**/*_spec.rb"

RSpec/VariableName:
AllowedPatterns:
- Authorization

0 comments on commit 1202d45

Please sign in to comment.