Skip to content

Commit 1202d45

Browse files
committed
Refactor RuboCop configs and restructure setup
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.
1 parent b20f4a1 commit 1202d45

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
inherit_gem: { servactory-rubocop: rubocop.yml }
1+
inherit_gem: { servactory-rubocop: rubocop-gem.yml }

rubocop.yml renamed to rubocop-gem.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ inherit_mode:
1111
- Exclude
1212

1313
AllCops:
14-
DisabledByDefault: true
1514
NewCops: enable
1615

1716
Style/HashSyntax:

rubocop-rails.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
require:
2+
- rubocop-factory_bot
3+
- rubocop-performance
4+
- rubocop-rails
5+
- rubocop-rake
6+
- rubocop-rspec
7+
- rubocop-rspec_rails
8+
9+
inherit_mode:
10+
merge:
11+
- Exclude
12+
13+
AllCops:
14+
NewCops: enable
15+
16+
################################################################################
17+
18+
Style/ClassAndModuleChildren:
19+
EnforcedStyle: compact
20+
Exclude:
21+
- config/application.rb
22+
23+
Style/Documentation:
24+
Enabled: false
25+
26+
Style/HashSyntax:
27+
EnforcedShorthandSyntax: always
28+
29+
Style/StringLiterals:
30+
EnforcedStyle: double_quotes
31+
32+
################################################################################
33+
34+
Rails/Output:
35+
Exclude:
36+
- db/**/*.rb
37+
38+
################################################################################
39+
40+
RSpec/EmptyExampleGroup:
41+
Exclude:
42+
- spec/requests/**/*.rb
43+
44+
RSpec/ExampleLength:
45+
Max: 20
46+
47+
RSpec/MultipleMemoizedHelpers:
48+
Max: 16
49+
50+
RSpec/NamedSubject:
51+
EnforcedStyle: named_only
52+
53+
RSpec/NestedGroups:
54+
Max: 10
55+
56+
RSpec/SpecFilePathFormat:
57+
Include:
58+
- "spec/**/*_spec.rb"
59+
Exclude:
60+
- "spec/requests/**/*_spec.rb"
61+
62+
RSpec/VariableName:
63+
AllowedPatterns:
64+
- Authorization

0 commit comments

Comments
 (0)