-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
143 lines (120 loc) · 3.17 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
---
inherit_from: .rubocop_todo.yml
Gemspec/RequireMFA:
# We publish via CI/CD, so MFA is not possible.
Enabled: false
Layout/LineLength:
Max: 120
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Lint/EmptyClass:
# some workarounds for circular dependencies require empty classes
AllowComments: true
# conflicts with solargraph wanting every parameter documented with
# actual name and subclassing
Lint/UnusedMethodArgument:
Enabled: false
# https://stackoverflow.com/questions/40934345/rubocop-25-line-block-size-and-rspec-tests
Metrics/BlockLength:
# Exclude DSLs
Exclude:
- 'Rakefile'
- '*.gemspec'
- '**/*.rake'
- 'spec/**/*.rb'
- 'feature/**/*.rb'
# I use keyword arguments for a poor man's dependency injection to cut
# down on the magic in my tests.
Metrics/ParameterLists:
CountKeywordArgs: false
# Can try removing this after I have a release installed with this
# fix (probably in rubocop-minitest 0.10.3):
#
# https://github.com/rubocop-hq/rubocop-minitest/pull/116
Minitest/TestMethodName:
Enabled: false
Naming/FileName:
Exclude:
- 'lib/checkoff.rb'
Naming/HeredocDelimiterNaming:
Enabled: false
Naming/MethodParameterName:
Enabled: true
AllowedNames:
# I don't think things on this list are a terribly hard convention
# for folks to learn. bbatsov also doesn't care much for this
# check:
#
# https://github.com/rubocop-hq/rubocop/issues/3666
- e # exception
- x # cartesian coordinates
- y # cartesian coordinates
- n # number of things
# by default (EnforcedStyle=NormalCase) this rule doesn't like
# things like check_1, check_2, etc and wants check1, check2, etc. I
# like the former.
#
# https://docs.rubocop.org/rubocop/cops_naming.html#namingvariablenumber
Naming/VariableNumber:
Enabled: true
EnforcedStyle: snake_case
#
# Add 'XX X' to the standard list
#
Style/CommentAnnotation:
Keywords:
- "TOD\
O"
- "FIXM\
E"
- "OPTIMIZ\
E"
- "HAC\
K"
- "REVIE\
W"
- "XX\
X"
Style/DocumentationMethod:
Enabled: true
Include:
- 'lib/checkoff/*.rb'
Style/StringLiterals:
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes
ConsistentQuotesInMultiline: true
# Solargraph needs to see a class inherited from Struct to recognize
# what's going on
Style/StructInheritance:
Enabled: false
# I like trailing commas in arrays and hashes. They let me insert new
# elements and see them as one line in a diff, not two.
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
# If I'm using one function name and returning the contents of an
# attribute, that's OK. The alternative would be this, which I find
# confusing and often not really what I mean:
#
# attr_reader :something_else
# alias_method :something, :something_else
Style/TrivialAccessors:
ExactNameMatch: true
Lint:
Severity: error
Metrics:
Severity: error
AllCops:
NewCops: enable
TargetRubyVersion: 3.0
Exclude:
- 'bin/*'
- 'vendor/**/*'
- 'sorbet/**/*'
require:
- rubocop-minitest
- rubocop-performance
- rubocop-rake