-
Notifications
You must be signed in to change notification settings - Fork 5
/
.rubocop.yml
151 lines (119 loc) · 3.65 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
# Contains personal customisations of Rubocop default rules
require:
- rubocop-rake
- rubocop-rspec
AllCops:
Exclude:
- "resume.rb"
- "strings_en.rb"
- "strings_it.rb"
- "strings_ja.rb"
# NOTE: Although this exclusion is in the default Rubocop config, it seems
# that CI still goes looking in the vendor directory and attempts to
# scan all files in all gems, so make the exclusion explicit here.
- "vendor/**/*"
- "bin/*"
TargetRubyVersion: 3.2
NewCops: enable
Layout/DotPosition:
EnforcedStyle: trailing
# NOTE: This cop is only disabled due to build-related issues on Windows
# via Appveyor.
Layout/EndOfLine:
Enabled: false
Layout/FirstArrayElementLineBreak:
Enabled: true
Layout/FirstHashElementLineBreak:
Enabled: true
Layout/FirstMethodArgumentLineBreak:
Enabled: true
Layout/FirstMethodParameterLineBreak:
Enabled: true
Layout/MultilineAssignmentLayout:
Enabled: true
EnforcedStyle: new_line
Layout/MultilineMethodCallIndentation:
Exclude:
- "spec/**/*"
- "resume.rb"
Metrics/AbcSize:
Max: 18
Metrics/BlockLength:
AllowedMethods:
- "before"
- "configure"
- "context"
- "describe"
- "new"
Metrics/MethodLength:
Max: 16
Metrics/ModuleLength:
Exclude:
- "spec/**/*.rb"
- "resume.rb"
Naming/RescuedExceptionsVariableName:
PreferredName: error
RSpec/ExampleLength:
# NOTE: Pretty much the fault of the FontExtractor module needing to mock
# out the entirety of its interaction with Zip::File, as well as the
# amount of expectations needed in the application_spec to trace the
# application flow all the way to opening a generated resume.
Max: 15
# NOTE: RSpec cop seems to ignore the AllCops directive and complains that
# the resume.rb file isn't a *_spec.rb file. Therefore, suppress that issue.
RSpec/FilePath:
Exclude:
- "resume.rb"
# NOTE: Increased maximum number of allowed expectations due to having
# expectations in before/after blocks becoming bad practice.
RSpec/MultipleExpectations:
Max: 6
# NOTE: I have lots of tests that require more than 5 let statements in order
# to make them intelligible.
RSpec/MultipleMemoizedHelpers:
Enabled: false
# NOTE: This deep nesting mostly due to the wide range of paths that gem
# installation and file fetching can take, and the different errors that
# can occur.
RSpec/NestedGroups:
Max: 8
Style/CaseEquality:
# NOTE: This is rule is disabled, but care should be made to
# *only ever* use `===` in `case` statements.
Enabled: false
Style/Documentation:
Exclude:
# NOTE: When the specs are added to the bottom of the generated one-sheet
# resume file, there is no top-level module documentation to go with it,
# and Rubocop seems to not be able to see that it exists earlier in the
# file. So, exclude resume.rb from Rubocop's document gaze.
- "resume.rb"
# No need to repeat top-level documentation for specs.
- "spec/**/*"
# NOTE: PDF generation requires string mutation, so this can't be used for now.
Style/FrozenStringLiteralComment:
Enabled: false
# NOTE: I'm still on the fence about Ruby 3.1's shorthand syntax...
Style/HashSyntax:
EnforcedShorthandSyntax: either
# NOTE: There are some places where having modifier-if just looks strange to me,
# so this rule is disabled.
Style/IfUnlessModifier:
Enabled: false
Style/ImplicitRuntimeError:
Enabled: true
Style/InlineComment:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/OptionHash:
Enabled: true
Style/Send:
Enabled: true
Style/StringLiterals:
EnforcedStyle: double_quotes
ConsistentQuotesInMultiline: true
Style/StringMethods:
Enabled: true
Style/SymbolArray:
Enabled: true