DEV: update rubocop rules

This commit is contained in:
Sam Saffron 2020-01-28 18:17:14 +11:00
parent 36bf06f623
commit 1480c88529
1 changed files with 33 additions and 9 deletions

View File

@ -1,13 +1,16 @@
require:
- rubocop-discourse
AllCops: AllCops:
TargetRubyVersion: 2.4 TargetRubyVersion: 2.4
DisabledByDefault: true DisabledByDefault: true
Exclude: Exclude:
- 'db/schema.rb' - "db/schema.rb"
- 'bundle/**/*' - "bundle/**/*"
- 'vendor/**/*' - "vendor/**/*"
- 'node_modules/**/*' - "node_modules/**/*"
- 'public/**/*' - "public/**/*"
- 'plugins/**/gems/**/*' - "plugins/**/gems/**/*"
# Prefer &&/|| over and/or. # Prefer &&/|| over and/or.
Style/AndOr: Style/AndOr:
@ -57,7 +60,7 @@ Layout/SpaceAroundOperators:
Enabled: true Enabled: true
Layout/SpaceBeforeFirstArg: Layout/SpaceBeforeFirstArg:
Enabled: true Enabled: true
# Defining a method with parameters needs parentheses. # Defining a method with parameters needs parentheses.
Style/MethodDefParentheses: Style/MethodDefParentheses:
@ -83,7 +86,7 @@ Layout/Tab:
Enabled: true Enabled: true
# Blank lines should not have any spaces. # Blank lines should not have any spaces.
Layout/TrailingBlankLines: Layout/TrailingEmptyLines:
Enabled: true Enabled: true
# No trailing whitespace. # No trailing whitespace.
@ -113,7 +116,7 @@ Layout/MultilineMethodCallIndentation:
Enabled: true Enabled: true
EnforcedStyle: indented EnforcedStyle: indented
Layout/AlignHash: Layout/HashAlignment:
Enabled: true Enabled: true
Bundler/OrderedGems: Bundler/OrderedGems:
@ -125,3 +128,24 @@ Style/SingleLineMethods:
Style/Semicolon: Style/Semicolon:
Enabled: true Enabled: true
AllowAsExpressionSeparator: true AllowAsExpressionSeparator: true
Style/RedundantReturn:
Enabled: true
DiscourseCops/NoChdir:
Enabled: true
Exclude:
- 'spec/**/*' # Specs are run sequentially, so chdir can be used
- 'plugins/*/spec/**/*'
DiscourseCops/NoURIEscapeEncode:
Enabled: true
Style/GlobalVars:
Enabled: true
Severity: warning
Exclude:
- 'lib/tasks/**/*'
- 'script/**/*'
- 'spec/**/*.rb'
- 'plugins/*/spec/**/*'