-
Notifications
You must be signed in to change notification settings - Fork 75
/
.rubocop.yml
168 lines (136 loc) · 3.98 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
AllCops:
TargetRubyVersion: 2.2
Exclude:
- 'spec/**/*'
- 'spec/private/**/*'
- 'spec/dummy/**/*'
- 'spec/factories/*.rb'
- 'spec/fixtures/**/*'
- 'fixtures/**/*'
- 'MissingAttachmentRecords/**/*'
# Rakefile is generated when Rails is initialised and therefore should be
# left as is
- 'Rakefile'
# spec_helper is generated when rspec is initialised and therefore should be
# left as is
- 'spec/spec_helper.rb'
- 'spec/dummy/**/*'
Style/SpaceInsideParens:
Enabled: false
# Looks ugly having your first method directly after the module/class declaration
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/EmptyLinesAroundClassBody:
Enabled: false
Style/EmptyLinesAroundMethodBody:
Enabled: false
Style/EmptyLinesAroundBlockBody:
Enabled: false
NumericLiterals:
Description: >-
Add underscores to large numeric literals to improve their
readability.
Enabled: false
# Rubymine disagrees and not sure how to fix Rubymine indentation right now
CaseIndentation:
Description: Indentation of when in a case/when/[else/]end.
Enabled: false
ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Enabled: false
# As a web app, as long as the team commit to using well named classes for
# controllers, models etc it should not be necessary to add top-level class
# documentation.
Documentation:
Enabled: false
# We shouldn't be committing code with debug statements left in (e.g. byebug or save_and_open_page),
# we don't understand the GDS rationale for disabling this check
Debugger:
Enabled: true
LineLength:
Description: Limit lines to 140 characters.
Enabled: true
Max: 140
Loop:
Description: >-
Use Kernel#loop with break rather than begin/end/until or
begin/end/while for post-loop tests.
Enabled: false
MethodCalledOnDoEndBlock:
Exclude:
- spec/**/*_spec.rb
Metrics/BlockNesting:
Description: 'Avoid excessive block nesting'
Enabled: false
Metrics/LineLength:
Exclude:
- spec/features/*_spec.rb
- spec/factories/*.rb
- spec/routing/**/*.rb
# Specs can get large and with good reason, no benefit splitting them up
Metrics/ModuleLength:
Exclude:
- spec/**/*_spec.rb
# The default size seems very restrictive bumping to something more usable
Metrics/ModuleLength:
Max: 500
Metrics/CyclomaticComplexity:
Max: 20
Metrics/MethodLength:
Description: 'Avoid methods longer than 10 lines of code.'
Enabled: false
Max: 30
Metrics/AbcSize:
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
# a Float.
Max: 60
Metrics/PerceivedComplexity:
Max: 15
RaiseArgs:
Description: 'Checks the arguments passed to raise/fail.'
Enabled: true
Style/BlockComments:
Description: 'Do not use block comments.'
Enabled: false
# Turn these off as can totally mess with the expect{...}.to syntax
Style/BlockDelimiters:
Exclude:
- spec/**/*_spec.rb
Style/ClassAndModuleCamelCase:
Exclude:
- lib/applications/**/*.rb
Style/ClassVars:
Exclude:
- lib/waste_exemptions/permitted_attributes.rb
Style/MethodName:
Exclude:
- lib/applications/**/*.rb
Style/RegexpLiteral:
Description: >-
Use %r for regular expressions matching more than
`MaxSlashes` '/' characters.
Use %r only for regular expressions matching more than
`MaxSlashes` '/' character.
Enabled: false
Style/VariableName:
Exclude:
- lib/applications/**/*.rb
SingleLineMethods:
Description: 'Avoid single-line methods.'
Enabled: false
SpaceBeforeFirstArg:
Description: >-
Checks that exactly one space is used between a method name
and the first argument for method calls without parentheses.
Enabled: false
Style/SpaceAroundKeyword:
Description: 'Use a space around keywords if appropriate.'
Enabled: false
SpaceAfterNot:
Description: Tracks redundant space after the ! operator.
Enabled: false
SpaceBeforeComment:
Description: >-
Checks for missing space between code and a comment on the
same line.
Enabled: false