-
Notifications
You must be signed in to change notification settings - Fork 641
/
.rubocop.yml
137 lines (112 loc) · 3.96 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
inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
# TravisCI runs `bundle install --path=${BUNDLE_PATH:-vendor/bundle}`
# causing our bundle to be installed in `gemfiles/vendor/bundle`.
# Regardless, we have no interest in linting files in our bundle :D
- gemfiles/vendor/bundle/**/*
# Specify lowest supported ruby version. If we committed our .ruby-version
# file, we wouldn't have to specify this (https://bit.ly/2vNTsue), but we
# don't commit that file because that would interfere with testing multiple
# rubies on CI.
#
# Should be same as `ruby-version` in `.github/workflows/test.yml`
TargetRubyVersion: 2.6
# Avoid empty lines in methods, they are a sign the method is too big.
Layout/EmptyLineAfterGuardClause:
Enabled: false
# Aim for 80, but 100 is OK.
Layout/LineLength:
Max: 100
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Please use normal indentation when aligning parameters.
#
# Good:
#
# method_call(
# a,
# b
# )
#
# method_call(a,
# b
# )
#
# Bad:
#
# method_call(a,
# b)
#
# The latter is harder to maintain and uses too much horizontal space.
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Metrics/AbcSize:
Exclude:
# In an ideal world tests would be held to the same ABC metric as production
# code. In practice, time spent doing so is not nearly as valuable as
# spending the same time improving production code.
- test/**/*
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/BlockLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/ClassLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/MethodLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/ModuleLength:
Enabled: false
# Sometimes prefixing a method name with get_ or set_ is a reasonable choice.
Naming/AccessorMethodName:
Enabled: false
# Having a consistent delimiter, like EOS, improves reading speed. The delimiter
# is syntactic noise, just like a quotation mark, and inconsistent naming would
# hurt reading speed, just as inconsistent quoting would.
Naming/HeredocDelimiterNaming:
Enabled: false
# Avoid single-line method definitions.
Style/EmptyMethod:
EnforcedStyle: expanded
# Avoid annotated tokens except in desperately complicated format strings.
# In 99% of format strings they actually make it less readable.
Style/FormatStringToken:
Enabled: false
# Too subtle to lint. Guard clauses are great, use them if they help.
Style/GuardClause:
Enabled: false
# Too subtle to lint. A multi-line conditional may improve readability, even if
# a postfix conditional would satisfy `Metrics/LineLength`.
Style/IfUnlessModifier:
Enabled: false
# Too subtle to lint. Use semantic style, but prefer `}.x` over `end.x`.
Style/BlockDelimiters:
Enabled: false
# Use the nested style because it is safer. It is easier to make mistakes with
# the compact style.
Style/ClassAndModuleChildren:
EnforcedStyle: nested
Style/Documentation:
Exclude:
- 'test/**/*'
# Both `module_function` and `extend_self` are legitimate. Most importantly,
# they are different (http://bit.ly/2hSQAGm)
Style/ModuleFunction:
Enabled: false
# `x > 0` is understood by more programmers than `x.positive?`
Style/NumericPredicate:
EnforcedStyle: comparison
# Use slashes for most patterns. Use %r when it reduces backslash escaping.
Style/RegexpLiteral:
AllowInnerSlashes: false
# We use words, like `$LOAD_PATH`, because they are much less confusing that
# arcane symbols like `$:`. Unfortunately, we must then `require "English"` in
# a few places, but it's worth it so that we can read our code.
Style/SpecialGlobalVars:
EnforcedStyle: use_english_names
Style/StringLiterals:
EnforcedStyle: double_quotes