Skip to content

Commit 5a7791b

Browse files
committed
Switch from custom Rubocop config to standardrb
This will create a bit of work now, but aligns us with the rest of the community and - most importantly - stops us from having to maintain a set of coding conventions, which is no fun.
1 parent ac54042 commit 5a7791b

5 files changed

Lines changed: 17 additions & 292 deletions

File tree

.rubocop-https---relaxed-ruby-style-rubocop-yml

Lines changed: 0 additions & 153 deletions
This file was deleted.

.rubocop.yml

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,8 @@
1-
inherit_from:
2-
- https://relaxed.ruby.style/rubocop.yml
1+
require:
2+
- standard
33

4-
Gemspec/RequiredRubyVersion:
5-
Enabled: false
6-
Layout/EmptyLinesAroundAttributeAccessor:
7-
Enabled: true
8-
Layout/SpaceAroundMethodCallOperator:
9-
Enabled: true
10-
Lint/DeprecatedOpenSSLConstant:
11-
Enabled: true
12-
Lint/MixedRegexpCaptureTypes:
13-
Enabled: true
14-
Lint/RaiseException:
15-
Enabled: true
16-
Lint/StructNewOverride:
17-
Enabled: true
18-
Style/AccessorGrouping:
19-
Enabled: true
20-
Style/BisectedAttrAccessor:
21-
Enabled: true
22-
Style/ExponentialNotation:
23-
Enabled: true
24-
Style/HashEachMethods:
25-
Enabled: true
26-
Style/HashTransformKeys:
27-
Enabled: true
28-
Style/HashTransformValues:
29-
Enabled: true
30-
Style/RedundantAssignment:
31-
Enabled: true
32-
Style/RedundantFetchBlock:
33-
Enabled: true
34-
Style/RedundantRegexpCharacterClass:
35-
Enabled: true
36-
Style/RedundantRegexpEscape:
37-
Enabled: true
38-
Style/SlicingWithRange:
39-
Enabled: true
40-
41-
# Disable this cop until this isssue gets a clear answer:
42-
# https://github.com/rubocop/rubocop/issues/10675
43-
Gemspec/DeprecatedAttributeAssignment:
44-
Enabled: false
4+
inherit_gem:
5+
standard: config/base.yml
456

467
AllCops:
478
TargetRubyVersion: 3.0
48-
Exclude:
49-
- tmp/**/*
50-
- "vendor/**/*"
51-
# Generated binstubs
52-
- bin/rake
53-
NewCops: enable
54-
55-
Style/FrozenStringLiteralComment:
56-
Exclude:
57-
- "**/bin/*"
58-
- "**/exe/*"
59-
- "spec/**/*"

.standard.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parallel: true # default: false
2+
format: progress # default: Standard::Formatter
Lines changed: 10 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,12 @@
1-
require: ["rubocop-rspec", "rubocop-rails", "rubocop-performance"]
1+
require:
2+
- standard
23

3-
AllCops: {TargetRubyVersion: 2.5, Exclude: ["spec/dummy/**/*", "sandbox/**/*", "vendor/**/*"]}
4+
inherit_gem:
5+
standard: config/base.yml
46

5-
Layout/ArgumentAlignment: {EnforcedStyle: with_fixed_indentation}
6-
Layout/DotPosition: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#layoutdotposition"}
7-
Layout/EmptyLinesAroundAttributeAccessor: {Enabled: true}
8-
Layout/FirstArgumentIndentation: {EnforcedStyle: "consistent"}
9-
Layout/FirstArrayElementIndentation: {EnforcedStyle: "consistent"}
10-
Layout/LineLength: {Enabled: true, Max: 120}
11-
Layout/MultilineOperationIndentation: {Enabled: false}
12-
Layout/SpaceAroundMethodCallOperator: {Enabled: true}
13-
Layout/SpaceBeforeBlockBraces: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#layoutspacebeforeblockbraces"}
14-
Layout/SpaceInsideParens: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#layoutspaceinsideparens"}
15-
Lint/AmbiguousRegexpLiteral: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#lintambiguousregexpliteral"}
16-
Lint/AssignmentInCondition: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#lintassignmentincondition"}
17-
Lint/DeprecatedOpenSSLConstant: {Enabled: true}
18-
Lint/MixedRegexpCaptureTypes: {Enabled: true}
19-
Lint/RaiseException: {Enabled: true}
20-
Lint/StructNewOverride: {Enabled: true}
21-
Metrics/AbcSize: {Enabled: false}
22-
Metrics/BlockLength: {Enabled: false}
23-
Metrics/BlockNesting: {Enabled: false}
24-
Metrics/ClassLength: {Enabled: false}
25-
Metrics/CyclomaticComplexity: {Enabled: false}
26-
Metrics/MethodLength: {Enabled: false}
27-
Metrics/ModuleLength: {Enabled: false}
28-
Metrics/ParameterLists: {Enabled: false}
29-
Metrics/PerceivedComplexity: {Enabled: false}
30-
Performance/AncestorsInclude: {Enabled: true}
31-
Performance/BigDecimalWithNumericArgument: {Enabled: true}
32-
Performance/RedundantSortBlock: {Enabled: true}
33-
Performance/RedundantStringChars: {Enabled: true}
34-
Performance/ReverseFirst: {Enabled: true}
35-
Performance/SortReverse: {Enabled: true}
36-
Performance/Squeeze: {Enabled: true}
37-
Performance/StringInclude: {Enabled: true}
38-
RSpec/DescribeClass: {Exclude: ["spec/features/**/*"]} # Feature specs are not describing any class or module.
39-
RSpec/ExampleLength: {Enabled: false}
40-
Style/AccessorGrouping: {Enabled: true}
41-
Style/Alias: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylealias"}
42-
Style/AsciiComments: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleasciicomments"}
43-
Style/BeginBlock: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylebeginblock"}
44-
Style/BisectedAttrAccessor: {Enabled: true}
45-
Style/BlockDelimiters: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleblockdelimiters"}
46-
Style/CommentAnnotation: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylecommentannotation"}
47-
Style/Documentation: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styledocumentation"}
48-
Style/DoubleNegation: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styledoublenegation"}
49-
Style/EndBlock: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleendblock"}
50-
Style/ExponentialNotation: {Enabled: true}
51-
Style/FormatString: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleformatstring"}
52-
Style/FrozenStringLiteralComment: {Exclude: ["spec/**/*", "db/migrate/**/*", "bin/**/*"]}
53-
Style/HashEachMethods: {Enabled: true}
54-
Style/HashTransformKeys: {Enabled: true}
55-
Style/HashTransformValues: {Enabled: true}
56-
Style/IfUnlessModifier: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleifunlessmodifier"}
57-
Style/Lambda: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylelambda"}
58-
Style/ModuleFunction: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylemodulefunction"}
59-
Style/MultilineBlockChain: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylemultilineblockchain"}
60-
Style/NegatedIf: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylenegatedif"}
61-
Style/NegatedWhile: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylenegatedwhile"}
62-
Style/NumericPredicate: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylenumericpredicate"}
63-
Style/ParallelAssignment: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleparallelassignment"}
64-
Style/PercentLiteralDelimiters: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylepercentliteraldelimiters"}
65-
Style/PerlBackrefs: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styleperlbackrefs"}
66-
Style/RedundantAssignment: {Enabled: true}
67-
Style/RedundantFetchBlock: {Enabled: true}
68-
Style/RedundantRegexpCharacterClass: {Enabled: true}
69-
Style/RedundantRegexpEscape: {Enabled: true}
70-
Style/Semicolon: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesemicolon"}
71-
Style/SignalException: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesignalexception"}
72-
Style/SingleLineBlockParams: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesinglelineblockparams"}
73-
Style/SingleLineMethods: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylesinglelinemethods"}
74-
Style/SlicingWithRange: {Enabled: true}
75-
Style/SpecialGlobalVars: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylespecialglobalvars"}
76-
Style/StringLiterals: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylestringliterals"}
77-
Style/SymbolArray: {Enabled: false, StyleGuide: "http://relaxed.ruby.style/#stylesymbolarray"}
78-
Style/TrailingCommaInArguments: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styletrailingcommainarguments"}
79-
Style/TrailingCommaInArrayLiteral: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styletrailingcommainarrayliteral"}
80-
Style/TrailingCommaInHashLiteral: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#styletrailingcommainhashliteral"}
81-
Style/WhileUntilModifier: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylewhileuntilmodifier"}
82-
Style/WordArray: {Enabled: false, StyleGuide: "https://relaxed.ruby.style/#stylewordarray"}
7+
AllCops:
8+
TargetRubyVersion: 3.0
9+
Exclude:
10+
- spec/dummy/**/*
11+
- sandbox/**/*
12+
- vendor/**/*

solidus_dev_support.gemspec

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ Gem::Specification.new do |spec|
4141
spec.add_dependency 'puma', '>= 4.3', '< 7.0'
4242
spec.add_dependency 'rspec_junit_formatter'
4343
spec.add_dependency 'rspec-rails', '>= 5.0', '< 7.0'
44-
spec.add_dependency 'rubocop', '~> 1.0'
45-
spec.add_dependency 'rubocop-performance', '~> 1.5'
46-
spec.add_dependency 'rubocop-rails', '~> 2.3'
47-
spec.add_dependency 'rubocop-rspec', '~> 2.0'
4844
spec.add_dependency 'selenium-webdriver', '~> 4.11'
4945
spec.add_dependency 'simplecov-cobertura', '~> 2.1'
5046
spec.add_dependency 'solidus_core', ['>= 2.0', '< 5']
47+
spec.add_dependency 'standard', '~> 1.49'
5148
end

0 commit comments

Comments
 (0)