summaryrefslogtreecommitdiff
path: root/.rubocop.yml
diff options
context:
space:
mode:
Diffstat (limited to '.rubocop.yml')
-rw-r--r--.rubocop.yml42
1 files changed, 34 insertions, 8 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index fa1370ea1f3..3cdafd96456 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -494,7 +494,13 @@ Style/TrailingBlankLines:
# This cop checks for trailing comma in array and hash literals.
Style/TrailingCommaInLiteral:
- Enabled: false
+ Enabled: true
+ EnforcedStyleForMultiline: no_comma
+
+# This cop checks for trailing comma in argument lists.
+Style/TrailingCommaInArguments:
+ Enabled: true
+ EnforcedStyleForMultiline: no_comma
# Checks for %W when interpolation is not needed.
Style/UnneededCapitalW:
@@ -533,13 +539,17 @@ Style/WhileUntilModifier:
Style/WordArray:
Enabled: true
+# Use `proc` instead of `Proc.new`.
+Style/Proc:
+ Enabled: true
+
# Metrics #####################################################################
# A calculated magnitude based on number of assignments,
# branches, and conditions.
Metrics/AbcSize:
Enabled: true
- Max: 60
+ Max: 57.08
# This cop checks if the length of a block exceeds some maximum value.
Metrics/BlockLength:
@@ -558,7 +568,7 @@ Metrics/ClassLength:
# of test cases needed to validate a method.
Metrics/CyclomaticComplexity:
Enabled: true
- Max: 17
+ Max: 16
# Limit lines to 80 characters.
Metrics/LineLength:
@@ -950,10 +960,20 @@ RSpec/DescribeClass:
RSpec/DescribeMethod:
Enabled: false
+# Avoid describing symbols.
+RSpec/DescribeSymbol:
+ Enabled: true
+
# Checks that the second argument to top level describe is the tested method
# name.
RSpec/DescribedClass:
- Enabled: false
+ Enabled: true
+
+# Checks if an example group does not include any tests.
+RSpec/EmptyExampleGroup:
+ Enabled: true
+ CustomIncludeMethods:
+ - run_permission_checks
# Checks for long example.
RSpec/ExampleLength:
@@ -973,12 +993,18 @@ RSpec/ExampleWording:
RSpec/ExpectActual:
Enabled: true
+# Checks for opportunities to use `expect { … }.to output`.
+RSpec/ExpectOutput:
+ Enabled: true
+
# Checks the file and folder naming of the spec file.
RSpec/FilePath:
- Enabled: false
- CustomTransform:
- RuboCop: rubocop
- RSpec: rspec
+ Enabled: true
+ IgnoreMethods: true
+ Exclude:
+ - 'qa/**/*'
+ - 'spec/javascripts/fixtures/*'
+ - 'spec/requests/api/v3/*'
# Checks if there are focused specs.
RSpec/Focus: