forked from ministryofjustice/peoplefinder
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.rubocop.yml
99 lines (82 loc) · 2.51 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
AllCops:
# Exclude anything that isn't really part of our code.
# rails_helper is excluded because it's full of solecisms, but it's mostly
# generated code and copy-and-pasted snipets from READMEs.
Exclude:
- 'vendor/**/*'
- 'db/**/*'
- 'bin/**/*'
- '**/*.gemspec'
- '**/Rakefile'
- '**/Vagrantfile'
- 'config/initializers/simple_form.rb'
- 'config/unicorn.rb'
- 'spec/rails_helper.rb'
- 'lib/tasks/brakeman.rake'
- 'lib/tasks/elasticsearch.rake'
- 'spec/dummy/db/**/*'
RunRailsCops: true
# private/protected/public
Style/AccessModifierIndentation:
EnforcedStyle: outdent
# Just indent parameters by two spaces. It's less volatile if methods change,
# and there's less busy work lining things up.
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation
# Allow ===. It's useful.
Style/CaseEquality:
Enabled: false
Style/CollectionMethods:
PreferredMethods:
inject: 'inject'
reduce: 'inject'
# Chain methods with trailing dots.
Style/DotPosition:
EnforcedStyle: trailing
# Percent-formatting and hash interpolation both have their place. Don't
# enforce any particular one.
Style/FormatString:
Enabled: false
# It's not really clearer to replace every if with a return if.
Style/GuardClause:
Enabled: false
Metrics/LineLength:
Max: 100
Exclude:
- 'spec/**/*'
# Don't worry about long methods in specs.
Metrics/MethodLength:
Max: 12
Exclude:
- 'spec/**/*'
# Enforce single quotes everywhere except in specs (because there's a lot of
# human text with apostrophes in spec names, and using double quotes for all
# of those is more consistent. There shouldn't be much human-readable text in
# the application code: that is better moved to the locale files.
Style/StringLiterals:
EnforcedStyle: single_quotes
Exclude:
- 'spec/**/*'
# Rubucop can't enforce Weirich style, so just turn this off.
Blocks:
Enabled: false
# Prefer sensible naming to comments everywhere.
Documentation:
Description: Document classes and non-namespace modules.
Enabled: false
# Would enforce do_y if x over if x / do y / end. As with GuardClause above,
# this enforces code organisation that doesn't necesarily make things clearer.
IfUnlessModifier:
Enabled: false
# Allow safe assignment in conditions.
Lint/AssignmentInCondition:
AllowSafeAssignment: false
# Just a preference to use %w[] over %w()
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%i': '[]'
'%w': '[]'
'%W': '[]'
ClassAndModuleChildren:
Enabled: false
require: rubocop-rspec