-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy path.rubocop.yml
More file actions
179 lines (150 loc) · 4.12 KB
/
.rubocop.yml
File metadata and controls
179 lines (150 loc) · 4.12 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
AllCops:
TargetRubyVersion: 3.2
SuggestExtensions: false
NewCops: enable
Exclude:
- 'vendor/**/*'
- '**/spec/dummy/**/*'
- '**/node_modules/**/*'
# Use double quotes only for interpolation.
Style/StringLiterals:
EnforcedStyle: single_quotes
# Place dots at the beginning of multiline method calls.
Layout/DotPosition:
EnforcedStyle: leading
# Allow using {} when chaining methods
Style/BlockDelimiters:
EnforcedStyle: braces_for_chaining
# The default of 80 characters is a little to narrow.
Layout/LineLength:
Max: 100
# Only place spaces inside blocks written with braces.
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
# Do not warn about missing magic comment
Style/FrozenStringLiteralComment:
Enabled: false
# Allow `json.(:attribute)`
Style/LambdaCall:
Enabled: false
# In specs methods using RSpec DSL often become complex
Metrics/AbcSize:
Max: 20
Exclude:
- '**/app/views/components/**/*.rb'
- '**/db/migrate/**/*.rb'
- '**/plugin.rb'
- '**/spec/**/*'
- '**/seeds.rb'
- 'lib/pageflow/ability_mixin.rb'
- 'lib/pageflow/configuration.rb'
- 'lib/pageflow/zencoder_video_output_definition.rb'
Metrics/PerceivedComplexity:
Exclude:
- '**/app/views/components/**/*.rb'
- '**/seeds.rb'
- 'lib/pageflow/ability_mixin.rb'
Metrics/CyclomaticComplexity:
Exclude:
- '**/app/views/components/**/*.rb'
- '**/seeds.rb'
- 'lib/pageflow/ability_mixin.rb'
# Certain files are long.
Metrics/ClassLength:
Max: 200
Exclude:
- 'lib/pageflow/configuration.rb'
- 'lib/pageflow/zencoder_video_output_definition.rb'
# Long spec and DSL files are ok. Ignore some historically long helpers.
Metrics/ModuleLength:
Exclude:
- 'admins/**/*.rb'
- 'app/helpers/pageflow/entries_helper.rb'
- 'app/helpers/pageflow/video_files_helper.rb'
- '**/seeds.rb'
- '**/ability_mixin.rb'
- '**/spec/**/*'
# Ignore DSLs
Metrics/BlockLength:
AllowedMethods:
- namespace
- included
- for_entry_type
- configure
- processing_state_machine
CountAsOne:
- method_call
Exclude:
- '**/*.arb'
- '**/*.gemspec'
- '**/*.jbuilder'
- '**/seeds.rb'
- '**/admins/pageflow/*.rb'
- '**/app/views/components/**/*.rb'
- '**/config/**/*.rb'
- '**/spec/**/*.rb'
# Ignore DSLs. Slightly longer methods are ok
Metrics/MethodLength:
Max: 20
CountAsOne:
- array
- hash
- method_call
Exclude:
- 'lib/pageflow/ability_mixin.rb'
- 'lib/pageflow/configuration.rb'
- '**/plugin.rb'
- '**/app/views/components/**/*'
- '**/db/migrate/**/*'
- '**/seeds.rb'
- '**/spec/**/*'
Metrics/ParameterLists:
CountKeywordArgs: false
# Do not require class documentation for specs and migrations
Style/Documentation:
Exclude:
- admins/**/*
- '**/spec/**/*'
- '**/generators/**/templates/*.rb'
- db/migrate/*
# Both ['...'] and %w(...) are fine
Style/WordArray:
Enabled: false
# Both [] and %i(...) are fine
Style/SymbolArray:
Enabled: false
# extend self is fine
Style/ModuleFunction:
Enabled: false
# Allow method names like has_text?
Naming/PredicatePrefix:
Enabled: false
# We use methods with side effects that return booleans. Those should not end with ?
Naming/PredicateMethod:
Enabled: false
# Especially for respond_to blocks and callbacks a one line proc sometimes read better
Style/SymbolProc:
Enabled: false
# Comparing with 0 is fine
Style/NumericPredicate:
Enabled: false
# !! is fine
Style/DoubleNegation:
Enabled: false
# Many policy and query classes inherit from base classes but don't need to call super
# in their initialize methods as they handle initialization differently
Lint/MissingSuper:
Enabled: false
# Standard identifiers like Creative Commons license names (cc_by_4) should keep their naming
Naming/VariableNumber:
Enabled: false
# Do not complain about nested classes at the end of classes with private methods
Lint/UselessConstantScoping:
Enabled: false
# Do not complain about development dependencies
Gemspec/DevelopmentDependencies:
Enabled: false
# Ignore empty specs and factory traits
Lint/EmptyBlock:
Exclude:
- '**/spec/**/*'