-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
103 lines (89 loc) · 2.72 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
AllCops:
TargetRubyVersion: 2.2
Include:
- '**/Rakefile'
- '**/config.ru'
Exclude:
- 'db/**/*'
- 'config/**/*'
- 'script/**/*'
- '.git-hooks/**/*'
- !ruby/regexp /old_and_unused\.rb$/
# Bin contains standard files created when Rails is initialised and
# therefore they should be left as is
- 'bin/**/*'
# Rakefile is generated when Rails is initialised and therefore should be
# left as is
- 'Rakefile'
# Tools area - some one-off/pragmatic stuff in here
- 'lib/datashift_journey/tools/*'
# spec_helper is generated when rspec is initialised and therefore should be
# left as is
- 'spec/spec_helper.rb'
- 'spec/dummy/**/*'
- '*.gemspec'
# New rule and seems to be a ruboco bug with automatic cleanup so disabling
# turns until(pc.valid?) into untilpc.valid? which ruby chokes on
# Looks cluttered/ugly having your first method directly after the module/class declaration
Style/EmptyLinesAroundModuleBody:
Enabled: false
Style/EmptyLinesAroundClassBody:
Enabled: false
Style/Lambda:
Enabled: false
Style/RedundantParentheses:
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
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
Metrics/CyclomaticComplexity:
Max: 10
#RSPEC SPECIFIC
# Turn these off as can totally mess with the expect{...}.to syntax
Style/BlockDelimiters:
Exclude:
- spec/**/*_spec.rb
Style/ClassVars:
Exclude:
- lib/waste_exemptions/permitted_attributes.rb
MethodCalledOnDoEndBlock:
Exclude:
- spec/**/*_spec.rb
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/MethodLength:
Max: 30
# As a web app, as long as the team commit to using well named classes for
# controllers, collector 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
Exclude:
- 'spec/factories/*.rb'
- 'spec/features/*_spec.rb'
- 'spec/routing/**/*_spec.rb'