-
Notifications
You must be signed in to change notification settings - Fork 75
/
.rubocop_cc.yml
140 lines (107 loc) · 3.22 KB
/
.rubocop_cc.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
inherit_from:
- .rubocop_todo.yml
AllCops:
TargetRubyVersion: 2.7
NewCops: enable
SuggestExtensions: false
Exclude:
- "node_modules/**/*"
- "**/vendor/**/*"
Bundler/DuplicatedGem:
Exclude:
- "spec/dummy/Gemfile"
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
# Allows for easier copy-pasting into shell and comments between lines
Layout/DotPosition:
EnforcedStyle: trailing
Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods
# For these files, the check fails on CI yet passes locally
Exclude:
- lib/skylight/probes/action_controller.rb
- spec/integration/rails_spec.rb
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
# Longer lines can be ok at times
Layout/LineLength:
Max: 121
Lint/DuplicateBranch:
IgnoreConstantBranches: true
IgnoreLiteralBranches: true
# This is behaving strangely where, when we try to disable it one-off, the Lint/RedundantCopDisableDirective
# says it was unnecessary to disable it.
Lint/EmptyBlock:
Enabled: false
# We shouldn't worry about this in specs
Lint/SuppressedException:
Exclude:
- "**/*_spec.rb"
# We do a lot of handling of all error classes. This seems probably ok for our case.
Lint/RescueException:
Enabled: false
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: true
# Doesn't make sense to have to split up module and context blocks
Metrics/BlockLength:
Exclude:
- "**/*_spec.rb"
# In some cases `get_*` or `set_*` seems more appropriate than without.
Naming/AccessorMethodName:
Enabled: false
Naming/PredicateName:
AllowedMethods:
- is_a? # Default
- has_errors? # Seems clearer than suggested `errors?`
# This is a bit too strict for us
Style/ClassAndModuleChildren:
Enabled: false
# It's nice to actually have boolean values
Style/DoubleNegation:
Enabled: false
# We don't necessarily need to document every module, but maybe we can remove this later.
Style/Documentation:
Enabled: false
Style/EnvHome:
Enabled: false
Style/GlobalVars:
Exclude:
- "ext/extconf.rb"
# Not convinced this makes things better
Style/GuardClause:
Enabled: false
# While long lines can be ok, having the condition after a long line isn't great
Style/IfUnlessModifier:
Enabled: false
Style/MixinUsage:
Exclude:
- "ext/extconf.rb"
# We use timestamps in some tests and this doesn't play nice
Style/NumericLiterals:
Enabled: false
Style/NumericPredicate:
Enabled: false
# Maybe we can revisit this later
Style/PerlBackrefs:
Enabled: false
# This isn't super helpful and has issues with multi-argument split
Style/RedundantArgument:
Enabled: false
# This may not be a great idea but we do it frequently. We should revisit.
Style/RescueModifier:
Enabled: false
# No performance penalty for double quotes and easier to be consistent
Style/StringLiterals:
EnforcedStyle: double_quotes
# Prettier wants this to match the above
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes
# We don't want to use warn because we want to treat these like errors.
Style/StderrPuts:
Enabled: false
# Peter and Zach don't like one line whiles
Style/WhileUntilModifier:
Enabled: false