Skip to content

Commit

Permalink
Rubocop: Bump Ruby version to 2.7 and add new cops
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles committed Jan 21, 2021
1 parent a8213b7 commit f314917
Showing 1 changed file with 72 additions and 6 deletions.
78 changes: 72 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# inherit_from: .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.4
TargetRubyVersion: 2.7

require:
- ./lib/rubocop/cop/layout/module_hash_on_new_line.rb
Expand All @@ -31,6 +31,42 @@ Lint/ModuleDisclosureDatePresent:
# Only exploits require disclosure dates, but they can be present in auxiliary modules etc.
- 'modules/exploits/**/*'

Lint/AmbiguousAssignment:
Enabled: true

Lint/DeprecatedConstants:
Enabled: true

Lint/DuplicateBranch:
Enabled: true

Lint/DuplicateRegexpCharacterClassElement:
Enabled: true

Lint/EmptyBlock:
Enabled: true

Lint/EmptyClass:
Enabled: true

Lint/LambdaWithoutLiteralBlock:
Enabled: true

Lint/NoReturnInBeginEndBlocks:
Enabled: true

Lint/RedundantDirGlobSort:
Enabled: true

Lint/ToEnumArguments:
Enabled: true

Lint/UnexpectedBlockArity:
Enabled: true

Lint/UnmodifiedReduceAccumulator:
Enabled: true

Metrics/ClassLength:
Description: 'Most Metasploit modules are quite large. This is ok.'
Enabled: true
Expand Down Expand Up @@ -79,6 +115,9 @@ Style/Documentation:
Exclude:
- 'modules/**/*'

Layout/SpaceBeforeBrackets:
Enabled: true

Layout/FirstArgumentIndentation:
Enabled: true
EnforcedStyle: consistent
Expand All @@ -98,6 +137,13 @@ Layout/FirstHashElementLineBreak:
Enabled: true
Description: 'Enforce consistency by breaking hash elements on to new lines'

Layout/LineLength:
Description: >-
Metasploit modules often pattern match against very
long strings when identifying targets.
Enabled: true
Max: 180

Layout/SpaceInsideArrayLiteralBrackets:
Enabled: false
Description: 'Almost all module metadata have space in brackets'
Expand Down Expand Up @@ -130,12 +176,32 @@ Style/TrailingCommaInArrayLiteral:
Enabled: false
Description: 'This is often a useful pattern, and is actually required by other languages. It does not hurt.'

Metrics/LineLength:
Description: >-
Metasploit modules often pattern match against very
long strings when identifying targets.
Style/ArgumentsForwarding:
Enabled: true

Style/CollectionCompact:
Enabled: true

Style/DocumentDynamicEvalDefinition:
Enabled: true

Style/EndlessMethod:
Enabled: true

Style/HashExcept:
Enabled: true

Style/NegatedIfElseCondition:
Enabled: true

Style/NilLambda:
Enabled: true

Style/RedundantArgument:
Enabled: true

Style/SwapValues:
Enabled: true
Max: 180

Metrics/BlockLength:
Enabled: true
Expand Down

0 comments on commit f314917

Please sign in to comment.