From 1480c885292db828dc079b30a4d6ccdc5786e9e0 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 28 Jan 2020 18:17:14 +1100 Subject: [PATCH] DEV: update rubocop rules --- ...om-discourse-discourse-master--rubocop-yml | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/.rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml b/.rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml index 0d66c3b..0a15cd9 100644 --- a/.rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml +++ b/.rubocop-https---raw-githubusercontent-com-discourse-discourse-master--rubocop-yml @@ -1,13 +1,16 @@ +require: + - rubocop-discourse + AllCops: TargetRubyVersion: 2.4 DisabledByDefault: true Exclude: - - 'db/schema.rb' - - 'bundle/**/*' - - 'vendor/**/*' - - 'node_modules/**/*' - - 'public/**/*' - - 'plugins/**/gems/**/*' + - "db/schema.rb" + - "bundle/**/*" + - "vendor/**/*" + - "node_modules/**/*" + - "public/**/*" + - "plugins/**/gems/**/*" # Prefer &&/|| over and/or. Style/AndOr: @@ -57,7 +60,7 @@ Layout/SpaceAroundOperators: Enabled: true Layout/SpaceBeforeFirstArg: - Enabled: true + Enabled: true # Defining a method with parameters needs parentheses. Style/MethodDefParentheses: @@ -83,7 +86,7 @@ Layout/Tab: Enabled: true # Blank lines should not have any spaces. -Layout/TrailingBlankLines: +Layout/TrailingEmptyLines: Enabled: true # No trailing whitespace. @@ -113,7 +116,7 @@ Layout/MultilineMethodCallIndentation: Enabled: true EnforcedStyle: indented -Layout/AlignHash: +Layout/HashAlignment: Enabled: true Bundler/OrderedGems: @@ -125,3 +128,24 @@ Style/SingleLineMethods: Style/Semicolon: Enabled: 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/**/*'