-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update RuboCop config source to pdobb-style gem
The new pdobb-style gem is an attempt to commonize my style guide across all of my gems and/or future projects. After updating to the new common base I had to fix a few issues in the existing code as well, coming from inclusion of the rubocop-performance gem that's now being included as well.
- Loading branch information
Paul DobbinSchmaltz
committed
Nov 21, 2023
1 parent
8bcaf83
commit 87f710a
Showing
5 changed files
with
17 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,195 +1,2 @@ | ||
require: | ||
- rubocop-rake | ||
- rubocop-minitest | ||
|
||
AllCops: | ||
NewCops: enable | ||
TargetRubyVersion: 2.7 | ||
UseCache: true | ||
DisplayCopNames: true | ||
DisplayStyleGuide: true | ||
ExtraDetails: true | ||
Exclude: | ||
# Rubocop Defaults | ||
- "node_modules/**/*" | ||
- "tmp/**/*" | ||
- "vendor/**/*" | ||
- ".git/**/*" | ||
# Custom additions | ||
- "script/**/*" | ||
|
||
Gemspec/DevelopmentDependencies: | ||
EnforcedStyle: gemspec # See: https://bundler.io/guides/creating_gem.html#testing-our-gem | ||
|
||
Layout/DotPosition: | ||
EnforcedStyle: trailing | ||
|
||
Layout/EmptyLineAfterGuardClause: | ||
Enabled: true | ||
|
||
Layout/EndOfLine: | ||
EnforcedStyle: lf | ||
|
||
Layout/FirstArgumentIndentation: | ||
EnforcedStyle: consistent_relative_to_receiver | ||
|
||
Layout/FirstArrayElementIndentation: | ||
EnforcedStyle: consistent | ||
|
||
Layout/FirstHashElementIndentation: | ||
EnforcedStyle: consistent | ||
|
||
Layout/FirstParameterIndentation: | ||
Enabled: false # Revisit if more settings become available. | ||
|
||
Layout/LineContinuationSpacing: | ||
EnforcedStyle: no_space | ||
|
||
Layout/LineEndStringConcatenationIndentation: | ||
EnforcedStyle: aligned | ||
|
||
Layout/LineLength: | ||
Max: 80 | ||
Exclude: | ||
- "say.gemspec" | ||
AllowedPatterns: | ||
# YARD doc `@example` output. | ||
- !ruby/regexp /\A *# \# => / | ||
- !ruby/regexp /\A *# =/ | ||
|
||
Layout/MultilineAssignmentLayout: | ||
Enabled: true | ||
SupportedTypes: | ||
- block | ||
- case | ||
- class | ||
- if | ||
# - kwbegin | ||
- module | ||
|
||
Layout/MultilineMethodCallBraceLayout: | ||
EnforcedStyle: same_line | ||
|
||
Layout/MultilineMethodCallIndentation: | ||
EnforcedStyle: indented_relative_to_receiver | ||
|
||
Layout/MultilineMethodDefinitionBraceLayout: | ||
EnforcedStyle: same_line | ||
|
||
Layout/MultilineOperationIndentation: | ||
Enabled: false # Waiting for e.g. `indented_relative_to_receiver`. | ||
|
||
# Lint/AmbiguousOperator: | ||
# Enabled: false # Conflicts with other rules. | ||
|
||
# Lint/AmbiguousRegexpLiteral: | ||
# Enabled: false # Conflicts with other rules. | ||
|
||
Lint/Void: | ||
CheckForMethodsWithNoSideEffects: true | ||
|
||
Metrics/BlockLength: | ||
AllowedMethods: | ||
- describe | ||
- context | ||
|
||
Metrics/ClassLength: | ||
CountAsOne: | ||
- array | ||
- heredoc | ||
- method_call | ||
Exclude: | ||
- "test/**/*" | ||
|
||
Metrics/ModuleLength: | ||
CountAsOne: | ||
- array | ||
- heredoc | ||
- method_call | ||
|
||
Naming/MethodParameterName: | ||
AllowedNames: | ||
- a | ||
- b | ||
|
||
Naming/RescuedExceptionsVariableName: | ||
PreferredName: ex | ||
|
||
Style/Alias: | ||
EnforcedStyle: prefer_alias_method | ||
|
||
Style/BlockDelimiters: | ||
EnforcedStyle: semantic | ||
AllowBracesOnProceduralOneLiners: true | ||
FunctionalMethods: | ||
# Minitest Spec DSL. (Rubocop defaults.) | ||
- let | ||
- let! | ||
- subject | ||
- watch | ||
# Overrides (Defaulted to Procedural by Rubocop.) | ||
- tap | ||
# MuchStub | ||
- call | ||
- on_call | ||
- spy | ||
# - tap (Already listed above.) | ||
- tap_on_call | ||
- with | ||
ProceduralMethods: # Defining this just to remove `tap` from the list. | ||
- benchmark | ||
- bm | ||
- bmbm | ||
- create | ||
- each_with_object | ||
- measure | ||
- new | ||
- realtime | ||
# - tap (Remove from Rubocop defaults.) | ||
- with_object | ||
|
||
Style/ClassAndModuleChildren: | ||
AutoCorrect: true | ||
EnforcedStyle: compact | ||
|
||
Style/Documentation: | ||
Exclude: | ||
- "test/**/*" | ||
- "script/**/*" | ||
|
||
Style/EmptyElse: | ||
Enabled: false # Including a comment in an empty else block shows intent. | ||
|
||
Style/EmptyMethod: | ||
EnforcedStyle: expanded | ||
|
||
Style/FormatString: | ||
Enabled: false # % notation with an Array just reads better sometimes. | ||
|
||
Style/Lambda: | ||
EnforcedStyle: literal | ||
|
||
Style/LambdaCall: | ||
Enabled: false # Allow ServiceObject.(*). Only use on classes, not instances. | ||
|
||
Style/RegexpLiteral: | ||
EnforcedStyle: mixed | ||
|
||
Style/RescueStandardError: | ||
EnforcedStyle: implicit | ||
|
||
Style/SingleLineMethods: | ||
Exclude: | ||
- "test/**/*_test.rb" | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: double_quotes | ||
|
||
Style/StringLiteralsInInterpolation: | ||
EnforcedStyle: double_quotes | ||
|
||
Style/TrailingCommaInArrayLiteral: | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/TrailingCommaInHashLiteral: | ||
EnforcedStyleForMultiline: comma | ||
inherit_gem: | ||
pdobb-style: .rubocop.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters