-
Notifications
You must be signed in to change notification settings - Fork 82
/
.rubocop.yml
163 lines (126 loc) · 3.63 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
inherit_from: .rubocop_todo.yml
AllCops:
TargetRubyVersion: 3.0
DisplayCopNames: true
NewCops: disable
Exclude:
- "benchmarks/**/*"
- "tmp/**/*"
- "vendor/**/*"
- "script/**/*.rb"
- "spec/fixtures/*.rb"
- "spec/ruby_version_specific/*.rb"
- "spec/*.rb"
# forces method defs to have params in parens
Style/MethodDefParentheses:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
# changes x != nil to !x.nil?
Style/NonNilCheck:
Enabled: false
# changes %{} to %()
Style/PercentLiteralDelimiters:
Enabled: false
# changes lambdas to ruby 1.9-style ->
# not compatible with ruby 1.8
Style/Lambda:
Enabled: false
# changes to new hash syntax
# not compatible with ruby 1.8
Style/HashSyntax:
Enabled: false
# we use unused method args a lot in tests/fixtures (a quirk of this lib)
Lint/UnusedMethodArgument:
Enabled: false
# changes x ** 2 to x**2
Layout/SpaceAroundOperators:
Enabled: false
# doesn't allow vars starting with _
Lint/UnderscorePrefixedVariableName:
Enabled: false
# enforces method length of 10 lines
Metrics/MethodLength:
Enabled: false
# forces you to document classes
# TODO: try to enable this cop
Style/Documentation:
Enabled: false
# enforces line length of 80
# TODO enable
Layout/LineLength:
Enabled: false
# triggered by Contract ({ :name => String, :age => Integer }) => nil
Lint/ParenthesesAsGroupedExpression:
Enabled: false
# checks how much a method branches.
# TODO try to get this cop enabled
Metrics/AbcSize:
Enabled: false
# checks complexity of method
# TODO try to get this cop enabled
Metrics/CyclomaticComplexity:
Enabled: false
# checks for too many nested ifs, whiles or rescues (but not too many nested blocks)
# TODO: try to get this cop enabled eventually
Metrics/BlockNesting:
Enabled: false
# calls out class variables.
# TODO: try to get this cop enabled eventually
Style/ClassVars:
Enabled: false
# enforces class length of < 100 lines
Metrics/ClassLength:
Enabled: false
# TODO: try to get this cop enabled eventually
Metrics/PerceivedComplexity:
Enabled: false
# checks for duplicate methods, but contracts
# provides this functionality (multi-dispatch)
Lint/DuplicateMethods:
Enabled: false
# checks to see if you could've used attr_accessor instead.
# nice in theory but noisy cop with false positives
Style/TrivialAccessors:
Enabled: false
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Asks you to use %w{array of words} if possible.
# Not a style I like.
Style/WordArray:
Enabled: false
# conflicts with contracts
# we define contracts like `Baz = 1`
Naming/ConstantName:
Enabled: false
# `Contract` violates this, otherwise a good cop (enforces snake_case method names)
# TODO possible to get this enabled but ignore `Contract`?
Naming/MethodName:
Enabled: false
# checks for !!
Style/DoubleNegation:
Enabled: false
# enforces < 5 params for a function.
# contracts-specific (long parameter list for test)
Metrics/ParameterLists:
Enabled: false
# Checks that braces used for hash literals have or don't have surrounding space depending on configuration.
Layout/SpaceInsideHashLiteralBraces:
Enabled: false
# TODO enable
Style/SpecialGlobalVars:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Naming/MemoizedInstanceVariableName:
Enabled: false
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/HashAlignment:
EnforcedColonStyle: table
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: consistent_comma