forked from Adrian-Hirt/l4n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
167 lines (124 loc) · 2.98 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
require:
- rubocop-performance
- rubocop-rails
AllCops:
Exclude:
- 'bin/*'
- 'tmp/**/*'
- 'vendor/**/*'
- '.git/**/*'
- 'db/schema.rb'
- 'locale/model_attributes.rb'
- 'node_modules/**/*'
- 'config/initializers/simple_form.rb'
- 'config/initializers/simple_form_bootstrap.rb'
NewCops: enable
SuggestExtensions: false
# General cops
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
Style/SignalException:
EnforcedStyle: only_fail
Style/ConditionalAssignment:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Layout/LineLength:
Enabled: false
Style/Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Enabled: false
Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/RedundantFetchBlock:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Enabled: true
Style/SlicingWithRange:
Enabled: true
Style/FormatStringToken:
Enabled: false
# Rails cops
Rails/BulkChangeTable:
Enabled: false
Rails/NotNullColumn:
Enabled: false
Style/AccessorGrouping:
EnforcedStyle: separated
Naming/VariableNumber:
EnforcedStyle: snake_case
# Sometimes we need different cases in haml files, e.g. for the `html5` argument
Exclude:
- 'app/views/**/*'
Layout/SpaceInsideParens:
# This cop seems broken for multiline hashes in HAML
Exclude:
- 'app/views/**/*'
Style/IfUnlessModifier:
# Disable this cop in the haml files
Exclude:
- 'app/views/**/*'
# Disable for test files
Metrics/ClassLength:
Exclude:
- test/**/*
Max: 150
Metrics/ModuleLength:
Exclude:
- test/**/*
Max: 150
Style/HashSyntax:
EnforcedShorthandSyntax: either
Rails/ActionControllerFlashBeforeRender:
Enabled: false
Rails/ActionOrder:
Enabled: false
Style/FormatString:
EnforcedStyle: percent
# Does not work in haml files
Layout/EmptyLineAfterGuardClause:
Exclude:
- 'app/views/**/*'
Rails/ThreeStateBooleanColumn:
# Ignore the already existing migrations, as we fix this in a
# new migration, such that the existing migrations remain unchanged
Exclude:
- db/migrate/20210524120137_add_otp_secret_key_to_users.rb
- db/migrate/20211220111608_create_pages.rb
- db/migrate/20220924131014_add_devise_two_factor_to_users.rb
# Does not work in haml files
Lint/RedundantCopDisableDirective:
Exclude:
- 'app/views/**/*'