Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubocop: Bump Ruby version to 2.5 and define new cops #14639

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
106 changes: 99 additions & 7 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.5

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

Lint/AmbiguousAssignment:
Description: 'TODO: review'
Enabled: false

Lint/DeprecatedConstants:
Description: 'TODO: review'
Enabled: false

Lint/DuplicateBranch:
Description: 'TODO: review'
Enabled: false

Lint/DuplicateRegexpCharacterClassElement:
Description: 'TODO: review'
Enabled: false

Lint/EmptyBlock:
Description: 'TODO: review'
Enabled: false

Lint/EmptyClass:
Description: 'TODO: review'
Enabled: false

Lint/LambdaWithoutLiteralBlock:
Description: 'TODO: review'
Enabled: false

Lint/NoReturnInBeginEndBlocks:
Description: 'TODO: review'
Enabled: false

Lint/RedundantDirGlobSort:
Description: 'TODO: review'
Enabled: false

Lint/ToEnumArguments:
Description: 'TODO: review'
Enabled: false

Lint/UnexpectedBlockArity:
Description: 'TODO: review'
Enabled: false

Lint/UnmodifiedReduceAccumulator:
Description: 'TODO: review'
Enabled: false

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

Layout/SpaceBeforeBrackets:
Description: 'TODO: review'
Enabled: false

Layout/FirstArgumentIndentation:
Enabled: true
EnforcedStyle: consistent
Expand All @@ -98,6 +150,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 +189,45 @@ 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.
Enabled: true
Max: 180
Style/TrailingCommaInHashLiteral:
Enabled: false
Description: 'This is often a useful pattern, and is actually required by other languages. It does not hurt.'

Style/ArgumentsForwarding:
Description: 'TODO: review'
Enabled: false

Style/CollectionCompact:
Description: 'TODO: review'
Enabled: false

Style/DocumentDynamicEvalDefinition:
Description: 'TODO: review'
Enabled: false

Style/EndlessMethod:
Description: 'TODO: review'
Enabled: false

Style/HashExcept:
Description: 'TODO: review'
Enabled: false

Style/NegatedIfElseCondition:
Description: 'TODO: review'
Enabled: false

Style/NilLambda:
Description: 'TODO: review'
Enabled: false

Style/RedundantArgument:
Description: 'TODO: review'
Enabled: false

Style/SwapValues:
Description: 'TODO: review'
Enabled: false

Metrics/BlockLength:
Enabled: true
Expand Down