This repository has been archived by the owner on Apr 17, 2020. It is now read-only.
/
.default_rubocop.yml
105 lines (83 loc) · 2.42 KB
/
.default_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
require: rubocop-rspec
# 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
# Use Weirich style
Style/BlockDelimiters:
EnforcedStyle: semantic
# Allow ===. It's useful.
Style/CaseEquality:
Enabled: false
Style/CollectionMethods:
PreferredMethods:
inject: 'inject'
reduce: 'inject'
Style/ConstantName:
Enabled: true
# Chain methods with trailing dots.
Style/DotPosition:
EnforcedStyle: trailing
Style/EachWithObject:
Enabled: false
# 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
Style/WordArray:
Exclude:
- 'spec/**/*'
Metrics/ClassLength:
Exclude:
- 'app/models/**/*'
Metrics/LineLength:
Max: 80
Exclude:
- 'spec/**/*'
- 'test/**/*'
# Don't worry about long methods in specs.
Metrics/MethodLength:
Max: 10
Exclude:
- 'spec/**/*'
- 'test/**/*'
# 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/**/*'
# Allow us to define simple predicate methods like foo? that look at the value
# of @foo. See https://github.com/bbatsov/rubocop/issues/2140
Style/TrivialAccessors:
AllowPredicates: true
# 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
# Don't 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
RSpec/DescribeClass:
Exclude:
- 'spec/features/**/*'