-
Notifications
You must be signed in to change notification settings - Fork 479
/
.rubocop.yml
168 lines (123 loc) · 3.59 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
168
inherit_from:
- .rubocop_hound.yml
- .rubocop_new.yml
- .rubocop_todo.yml
require:
- rubocop-performance
- rubocop-rails
- rubocop-rails-accessibility
- './tools/customLinters/rubocop_only_allowed_characters.rb'
- './tools/customLinters/rubocop_prefer_mocha_stubs_to_minitest_stub.rb'
- './tools/customLinters/rubocop_pegasus_db_usage.rb'
- './tools/customLinters/rubocop_dashboard_db_usage.rb'
- './tools/customLinters/rubocop_pegasus_requires.rb'
- './tools/customLinters/rubocop_dashboard_requires.rb'
- './tools/customLinters/rubocop_grouped_inline_private_methods.rb'
- './tools/customLinters/rubocop_dashboard_webmock_require_order.rb'
AllCops:
SuggestExtensions: false
Exclude:
- 'apps/**/*'
- 'dashboard/db/schema.rb'
- 'pegasus/test/test_string.rb' # Parser does not support non-utf8 escape sequences
DisplayCopNames: true
TargetRubyVersion: 2.7
Rails:
Enabled: true
Include:
- dashboard/**/* # only run Rails cops on Rails-specific code
Exclude:
- dashboard/legacy/**/*
# BEGIN CODE.ORG OVERRIDES
CustomCops/OnlyAllowedCharacters:
Include:
- '**/*_mailer.rb'
Layout/DotPosition:
EnforcedStyle: trailing
Layout/EmptyLineBetweenDefs:
AllowAdjacentOneLineDefs: true
Layout/FirstParameterIndentation:
EnforcedStyle: consistent
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: new_line
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Layout/SpaceInsideBlockBraces:
EnforcedStyle: no_space
SpaceBeforeBlockParameters: false
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
Naming/RescuedExceptionsVariableName:
PreferredName: exception
# This Cop by default uses a custom Include directive which in our
# project would also include pegasus
# see https://github.com/rubocop/rubocop-rails/blob/d81af275bba3d06e30156596c2c057cf68f8272b/config/default.yml#L213C11-L213C11
Rails/AssertNot:
Include:
- dashboard/**/test/**/*
Rails/Date:
EnforcedStyle: strict
Rails/RefuteMethods:
EnforcedStyle: refute
Style/AccessModifierDeclarations:
EnforcedStyle: inline
Style/EmptyElse:
EnforcedStyle: empty
Style/EmptyMethod:
EnforcedStyle: expanded
Style/NumericLiterals:
MinDigits: 7
Style/Semicolon:
AllowAsExpressionSeparator: true
Style/WordArray:
MinSize: 5
# END CODE.ORG OVERRIDES
# BEGIN BLOCKLIST: Below are rules we don't plan to enable in the forseeable
# future. Rules we plan to fix (but are currently failing) belong in
# .rubocop_todo.yml.
Metrics/BlockLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
Metrics/BlockNesting:
Enabled: false
Layout/ClosingParenthesisIndentation:
Enabled: false
Layout/ExtraSpacing:
Enabled: false
Layout/LineLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
# ActiveRecord does not implement a `detect` method and `find` has its own
# meaning. Correcting ActiveRecord methods with this cop should be considered
# unsafe, so out of an abundance of caution disable this everywhere.
Performance/Detect:
Enabled: false
Style/AsciiComments:
Enabled: false
Style/BarePercentLiterals:
Enabled: false
Style/IdenticalConditionalBranches:
Enabled: false
Style/IfInsideElse:
Enabled: false
Layout/LeadingCommentSpace:
Enabled: false
Style/NumericPredicate:
Enabled: false
Style/RedundantReturn:
Enabled: false
Style/StringLiterals:
Enabled: false
Style/TrivialAccessors:
AllowDSLWriters: true
Style/SymbolArray:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
# END BLOCKLIST