-
Notifications
You must be signed in to change notification settings - Fork 639
Expand file tree
/
Copy path.rubocop.yml
More file actions
164 lines (126 loc) · 3.71 KB
/
.rubocop.yml
File metadata and controls
164 lines (126 loc) · 3.71 KB
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
inherit_from: .rubocop_todo.yml
plugins:
- rubocop-performance
- rubocop-rake
- rubocop-rspec
AllCops:
NewCops: enable
# Bundler
Bundler/OrderedGems:
# Sort the gemspec dependencies by logical order instead of alphabetical.
Enabled: false
# Gemspec
Gemspec/OrderedDependencies:
# Sort the gemspec dependencies by logical order instead of alphabetical.
Enabled: false
# Layout
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/SpaceInsideArrayPercentLiteral:
# Sometimes spacing is used to align amounts.
Enabled: false
# Lint
Lint/BinaryOperatorWithIdenticalOperands:
# In specs we want to test instances of Money are really equal.
Exclude:
- 'spec/**/*'
Lint/EmptyClass:
# Allow defining empty classes, since it can be used as a base class.
Enabled: false
# Naming
Naming/PredicateMethod:
AllowedMethods:
# In Ruby, the convention is to return `nil` and not `false` when calling
# `#nonzero?`.
- nonzero?
# RSpec
RSpec/DescribedClass:
Exclude:
# Prefer Money.new(…) to described_class.new(…)
- 'spec/money_spec.rb'
- 'spec/money/formatting_spec.rb'
RSpec/IdenticalEqualityAssertion:
# Allow identical expressions on both sides of the equality since we are
# testing defining equality.
Enabled: false
RSpec/MultipleExpectations:
# Do not limit the amount of expectations in a spec
Enabled: false
RSpec/VerifiedDoubles:
# Allow building unverified doubles with `double :foo`.
IgnoreSymbolicNames: true
# Style
Style/ClassAndModuleChildren:
# Sometimes the nested is better than the compact.
Enabled: false
Style/Documentation:
# Not all modules need a comment.
Enabled: false
Style/FrozenStringLiteralComment:
# Add `# frozen_string_literal: true` to all files.
EnforcedStyle: always_true
SafeAutoCorrect: true
Style/GuardClause:
# Not enforced since guard clauses can cause long lines as well.
Enabled: false
Style/IfUnlessModifier:
# Not enforced since having an if on its own line can help shorten a line.
Enabled: false
Style/NumericPredicate:
# Sometimes we prefer testing `== 0` over `.zero?`.
Enabled: false
Style/NumericLiterals:
# Some numbers in specs are tricky to represent with regular spacing.
Enabled: false
Style/OptionalBooleanParameter:
# We also need backwards compatiblity so it doesn’t always make sense to
# disallow arguments with a boolean default value.
Enabled: false
Style/PreferredHashMethods:
# Money::FormattingRules has `#has_key?` but not `#key?`.
Enabled: false
Style/QuotedSymbols:
# Prefer :"some symbol" to :'some symbol'.
EnforcedStyle: double_quotes
Style/ReturnNilInPredicateMethodDefinition:
AllowedMethods:
# In Ruby, the convention is to return `nil` and not `false` when calling
# `#nonzero?`.
- nonzero?
Style/SafeNavigation:
# Allow calling `foo && foo.bar` instead of `foo&.bar` since `foo` can also
# be false.
Enabled: false
Style/StringLiterals:
# Prefer "double quotes" over 'single quotes'.
EnforcedStyle: double_quotes
Style/SymbolArray:
# Prefer [:a, :b] to %i[a b]
EnforcedStyle: brackets
Style/TrailingCommaInArguments:
# Prefer trailing commas in multiline arguments:
# call(
# a: 1,
# b: 2,
# )
EnforcedStyleForMultiline: diff_comma
Style/TrailingCommaInArrayLiteral:
# Prefer trailing commas in arrays:
# [
# 1,
# 2,
# ]
EnforcedStyleForMultiline: diff_comma
Style/TrailingCommaInHashLiteral:
# Prefer trailing commas in multiline hashes:
# {
# a: 1,
# b: 2,
# }
EnforcedStyleForMultiline: diff_comma
Style/YodaCondition:
# Sometimes in specs it makes more sense to write
# 2 >= Money.new(2, 'USD')
# over
# Money.new(2, 'USD') <= 2
Enabled: false