Skip to content

Commit

Permalink
Enable and fix new cops
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Jan 3, 2021
1 parent 9cdc07b commit b95ce9a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ Layout/SpaceAroundMethodCallOperator:
Description: Checks method call operators to not have spaces around them.
Enabled: true

Layout/SpaceBeforeBrackets:
Enabled: true

Layout/SpaceInsideHashLiteralBraces:
Description: Use spaces inside hash literal braces - or don't.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#spaces-operators
EnforcedStyle: no_space

Lint/AmbiguousAssignment:
Enabled: true

Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
Exclude:
Expand All @@ -66,12 +72,24 @@ Lint/DeprecatedOpenSSLConstant:
Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
Enabled: true

Lint/DuplicateBranch:
Enabled: true

Lint/DuplicateElsifCondition:
Enabled: true

Lint/DuplicateRegexpCharacterClassElement:
Enabled: true

Lint/DuplicateRescueException:
Enabled: true

Lint/EmptyBlock:
Enabled: true

Lint/EmptyClass:
Enabled: true

Lint/EmptyConditionalBody:
Enabled: true

Expand All @@ -85,6 +103,9 @@ Lint/MixedRegexpCaptureTypes:
Description: Do not mix named captures and numbered captures in a Regexp literal.
Enabled: true

Lint/NoReturnInBeginEndBlocks:
Enabled: true

Lint/OutOfRangeRegexpRef:
Enabled: true

Expand All @@ -99,9 +120,18 @@ Lint/StructNewOverride:
Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
Enabled: true

Lint/ToEnumArguments:
Enabled: true

Lint/TopLevelReturnWithArgument:
Enabled: true

Lint/UnexpectedBlockArity:
Enabled: true

Lint/UnmodifiedReduceAccumulator:
Enabled: true

Lint/UnreachableLoop:
Enabled: true

Expand Down Expand Up @@ -147,6 +177,9 @@ Naming/FileName:
Style/AccessorGrouping:
Enabled: true

Style/ArgumentsForwarding:
Enabled: true

Style/ArrayCoercion:
Enabled: true

Expand All @@ -156,6 +189,9 @@ Style/BisectedAttrAccessor:
Style/CaseLikeIf:
Enabled: true

Style/CollectionCompact:
Enabled: true

Style/CollectionMethods:
Description: Enforces the use of consistent method names from the Enumerable module.
PreferredMethods:
Expand All @@ -173,6 +209,9 @@ Style/DoubleNegation:
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-bang-bang
Enabled: false

Style/DocumentDynamicEvalDefinition:
Enabled: true

Style/ExplicitBlockArgument:
# capturing as a proc has a performance hit, so is a case by case choice
Enabled: false
Expand Down Expand Up @@ -204,6 +243,9 @@ Style/HashEachMethods:
Description: Use Hash#each_key and Hash#each_value.
Enabled: true

Style/HashExcept:
Enabled: true

Style/HashLikeCase:
Enabled: true

Expand All @@ -219,9 +261,18 @@ Style/HashSyntax:
Description: Checks hash literal syntax.
EnforcedStyle: ruby19

Style/NegatedIfElseCondition:
Enabled: true

Style/NilLambda:
Enabled: true

Style/OptionalBooleanParameter:
Enabled: true

Style/RedundantArgument:
Enabled: true

Style/RedundantAssignment:
Enabled: true

Expand Down Expand Up @@ -265,6 +316,9 @@ Style/StringLiterals:
Description: Allow double-quoted strings without interpolation.
EnforcedStyle: double_quotes

Style/SwapValues:
Enabled: true

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: no_comma

Expand Down
2 changes: 1 addition & 1 deletion lib/simplecov/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def configure(&block)
# end
#
def at_exit(&block)
return proc {} unless running || block_given?
return Proc.new unless running || block_given?

@at_exit = block if block_given?
@at_exit ||= proc { SimpleCov.result.format! }
Expand Down
1 change: 1 addition & 0 deletions spec/result_merger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
Timeout.timeout(1) do
SimpleCov::ResultMerger.synchronize_resultset do
SimpleCov::ResultMerger.synchronize_resultset do
# nothing
end
end
end
Expand Down

0 comments on commit b95ce9a

Please sign in to comment.