forked from WikiEducationFoundation/WikiEduDashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
195 lines (184 loc) · 5.06 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
require:
- rubocop-rails
- rubocop/rspec/focused
- rubocop-rspec
- rubocop-performance
Style/Documentation:
Enabled: false
AllCops:
Exclude:
- 'Gemfile'
- 'Guardfile'
- 'Rakefile'
- 'db/*'
- 'db/**/*'
- 'node_modules/**/*'
- 'config/**/*'
- 'bin/**/*'
- 'vendor/**/*'
- 'app/views/**/**/*.haml'
- 'docs/**/*'
- 'setup/*'
TargetRubyVersion: 2.5
Layout/LineLength:
Max: 100
Metrics/ClassLength:
Max: 127 # We should bring this down, ideally to the default of 100
Exclude: # These are too big, and should be shrunk if feasible.
- 'app/models/course.rb'
- 'app/controllers/surveys_controller.rb'
- 'app/controllers/campaigns_controller.rb'
- 'app/controllers/courses_controller.rb'
- 'lib/importers/revision_score_importer.rb'
- 'lib/wizard_timeline_manager.rb'
- 'lib/wiki_course_edits.rb'
Metrics/AbcSize:
Max: 23 # We should bring this down, ideally to the default of 15
Exclude:
- 'spec/**/*' # not a big deal in spec helper methods
Style/NumericPredicate:
Exclude:
- 'spec/**/*' # RSpec comparison matchers don't have predicate versions
Metrics/BlockLength:
Exclude:
- 'spec/**/*' # pretty much impossible with RSpec
- 'lib/tasks/*' # also impractical for Rake tasks
- 'app/views/**/*' # jbuilder requires long blocks for large json views
Metrics/MethodLength:
Max: 16 # We should bring this down, ideally to the default of 10
Exclude:
- 'spec/**/*' # not a big deal in spec helper methods
Metrics/ModuleLength:
Exclude:
- 'spec/**/*' # not a big deal in spec helper module
- 'app/helpers/surveys_helper.rb' # this is too big and should be shrunk
########################
# Recently-added rules #
########################
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
########################
# Permanent exceptions #
########################
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/ColonMethodCall:
Enabled: false
Style/NumericLiterals:
# We should use underscores when the number is meaningful. But when it's
# an arbitrary number like a user id, underscores are just clutter.
Enabled: false
Style/AsciiComments:
Enabled: false # We need non-ascii characters to document Wikipedia stuff.
Style/ParallelAssignment:
Enabled: false # We generally use this only to initialize empty variables.
Style/RedundantReturn:
Enabled: false # Sometimes a redundant return enhances clarity.
Style/SymbolArray:
Enabled: false # Rare syntax that is potentially confusing to newcomers.
Naming/VariableNumber:
Enabled: false # Not very helpful, and conflicts with wp10-related names
Rails/Blank:
Enabled: false # Sometimes unless foo.present? is more expressive.
Layout/EmptyLineAfterMagicComment:
Enabled: false # These get removed whenever 'annotate' updates a file anyway.
Naming/MethodParameterName:
Enabled: false # This is too restrictive. Calling errors `e` is fine, for example.
Layout/EmptyLineAfterGuardClause:
Enabled: false # Not very helpful
Layout/TrailingWhitespace: # To disallow trailing whitespaces
Enabled: true
Layout/HashAlignment:
Enabled: false # Hashes look uglier when corrected
########################
# Temporary exceptions #
########################
# These should be enabled once violations are fixed,
# or they should be moved to the 'Permanent' section
# if we decide they shouldn't be fixed.
Rails/FilePath:
Enabled: false
Rails/SkipsModelValidations:
Enabled: false
Rails/OutputSafety:
Enabled: false
Performance/UnfreezeString:
Enabled: false
Style/GuardClause:
Enabled: false
Rails/HasManyOrHasOneDependent:
Enabled: false
Rails/InverseOf:
Enabled: false
Rails/UnknownEnv:
Enabled: false
Rails/Delegate:
Enabled: false
Rails/HasAndBelongsToMany:
Enabled: false
Rails/Validation:
Enabled: false
Rails/FindBy:
Enabled: false
Rails/Output:
Enabled: false
Rails/RakeEnvironment:
Enabled: false
Naming/MemoizedInstanceVariableName:
Enabled: false
Rails/ActiveRecordAliases:
Enabled: false
Style/ExpandPathArguments:
Enabled: false
Layout/ClosingHeredocIndentation:
Enabled: false # buggy in 0.57.2: https://github.com/rubocop-hq/rubocop/issues/6009
RSpec/InstanceVariable:
Enabled: false
RSpec/ExampleLength:
Enabled: false
RSpec/NamedSubject:
Enabled: false
RSpec/ContextWording:
Enabled: false
RSpec/NestedGroups:
Enabled: false
RSpec/VerifiedDoubles:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/BeforeAfterAll:
Enabled: false
RSpec/EmptyExampleGroup:
Enabled: false
RSpec/ScatteredLet:
Enabled: false
RSpec/LetSetup:
Enabled: false
RSpec/AnyInstance:
Enabled: false
RSpec/RepeatedDescription:
Enabled: false
RSpec/MessageSpies:
Enabled: false
Capybara/CurrentPathExpectation:
Enabled: false
RSpec/DescribeClass:
Enabled: false
RSpec/ExpectInHook:
Enabled: false
RSpec/ScatteredSetup:
Enabled: false
RSpec/MultipleDescribes:
Enabled: false
RSpec/ExampleWording:
Enabled: false
RSpec/Be:
Enabled: false
Style/DateTime:
Enabled: false