forked from department-of-veterans-affairs/betamocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
83 lines (68 loc) · 2.25 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
AllCops:
TargetRubyVersion: 2.3
Include:
- '**/config.ru'
- '**/Rakefile'
- '**/*.rake'
Exclude:
- '**/*.gemspec'
- '**/Gemfile'
- 'db/**/*'
- 'script/**/*'
- 'vendor/**/*'
# This allows you to use have writers like self.method_name(name) vs self.method_name=(name)
Style/TrivialAccessors:
AllowDSLWriters: true
# This is the rubocop default but putting it here explicitly
# strong benefit for code readability and speed in reviewing PRs for code review
# only use double quote when doing interpolation or complex escape sequences
Style/StringLiterals:
EnforcedStyle: single_quotes
Style/Documentation:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
# This cop forces you to put a return at the beginning of a block of code rather than having an if statement
# whose body carries to the end of the function. For example:
#
# def foo
# ...
# if test
# ...
# end
# end
#
# would be considered bad, and the cop would force you to put a `return if !test` before that block and
# then remove the if. The problem is that this hides intent, since the if test does have a purpose in
# readability, and it could also be easier for future changes to miss the return statement and add code
# after it expecting it to be executed.
Style/GuardClause:
Enabled: false
# This is pretty much the same thing as the one above. Inside a loop, it forces you to use next to skip
# iteration rather than using an if block that runs to the end of the loop, and it suffers from the same
# problems as above.
Style/Next:
Enabled: false
# This forces you to replace things like: `[1, 2, 3].length == 0` with `[1,2,3].empty?`. The problem is that
# not all things that implement length also implement empty? so you will get errors that cannot be resolved,
# and the cop will encourage you to do things that are incorrect.
Style/ZeroLengthPredicate:
Enabled: false
Metrics/LineLength:
Max: 120
Rails:
Enabled: true
Rails/Output:
Exclude:
- 'lib/tasks/**/*'
Metrics/MethodLength:
Max: 20
Metrics/ClassLength:
Max: 400
Metrics/BlockLength:
ExcludedMethods: ['describe', 'context']
Metrics/AbcSize:
Max: 40
# removing rule because get_session implies HTTP GET, and informs method
Style/AccessorMethodName:
Enabled: false