/
.rubocop.yml
147 lines (146 loc) · 3.09 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
---
require:
- rubocop-rspec
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
Include:
- "**/Rakefile"
- "**/config.ru"
- "**/*.rb"
TargetRubyVersion: 3.1
NewCops: enable
# Bug in rubocop-rspec config merge: https://github.com/rubocop/rubocop-rspec/pull/1163
RSpec:
Language:
ExampleGroups:
Regular:
# rswag example group aliases
- path
- get
- push
- post
- delete
- stepwise
Examples:
Regular:
# custom dsl for permissions tests
- the_users
- the_user
- step
# Customized options
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Layout/LineLength:
Max: 120
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/EndOfLine:
EnforcedStyle: lf
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
# We sometimes leave commented out code in the code base
Layout/LeadingCommentSpace:
Enabled: false
Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
Metrics/ClassLength:
Max: 300
Metrics/CyclomaticComplexity:
Max: 10
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Metrics/BlockLength:
AllowedMethods:
- resource
- describe
- example_group
- shared_examples_for
- shared_examples
- shared_context
- context
- it
- group
- namespace
- task
- draw
- setup
- configure
- draw
- define
- factory
- path
- Async
- aasm
- stepwise
Metrics/MethodLength:
Max: 30
AllowedMethods:
- filter_settings
Metrics/ModuleLength:
Max: 150
Metrics/AbcSize:
Max: 60
# https://github.com/rubocop/rubocop-rspec/issues/795
RSpec/DescribedClass:
EnforcedStyle: explicit
RSpec/ExampleLength:
Max: 200
RSpec/ExpectInHook:
# https://github.com/rubocop/rubocop-rspec/pull/445
Enabled: false
RSpec/ImplicitSubject:
EnforcedStyle: single_statement_only
RSpec/MultipleExpectations:
Max: 6
RSpec/NestedGroups:
Max: 4
RSpec/MultipleMemoizedHelpers:
Max: 10
RSpec/VariableName:
IgnoredPatterns:
# Variable named after http header required by rswag
- ^Authorization$
RSpec/NamedSubject:
# referring to subject explicitly is referring to a named variable - named subject
# I disagree with this style rule.
Enabled: false
Style/AsciiComments:
# emoji are useful
Enabled: false
Style/BlockDelimiters:
EnforcedStyle: semantic
AllowBracesOnProceduralOneLiners: true
AllowedMethods:
- its
- it
Style/ExponentialNotation:
Enabled: true
EnforcedStyle: scientific
Style/HashEachMethods:
Enabled: true
AutoCorrect: false
Style/HashTransformKeys:
Enabled: true
AutoCorrect: false
Style/HashTransformValues:
Enabled: true
AutoCorrect: false
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
Style/SlicingWithRange:
Enabled: true
Style/SymbolArray:
EnforcedStyle: brackets
Style/WordArray:
EnforcedStyle: brackets