-
Notifications
You must be signed in to change notification settings - Fork 10
/
.rubocop.yml
184 lines (141 loc) · 3.99 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
# List of cops can be found here:
# https://github.com/bbatsov/rubocop/blob/master/config/default.yml
# https://github.com/bbatsov/rubocop/blob/master/config/disabled.yml
# https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
require:
- rubocop-minitest
- rubocop-performance
- rubocop-rails
inherit_from:
- https://raw.githubusercontent.com/ualbertalib/library_applications_development_inclusive_language/main/inclusive_language_rubocop.yml
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
Exclude:
- "db/**/*"
- "tmp/**/*"
- "vendor/**/*"
- "Dangerfile"
- "node_modules/**/*"
ExtraDetails: true
NewCops: enable
TargetRubyVersion: 3.1
# readability is Actually Good
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines_except_namespace
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: normal
Layout/LineLength:
Enabled: true
Max: 120 # default is 80
AllowedPatterns: ['\A\s*#'] # tweak to ignore long comments, which often are examples or URLs that are not easily broken up
# readability is Actually Good
Layout/RescueEnsureAlignment:
Enabled: false
Layout/BeginEndAlignment:
Enabled: false
# A calculated magnitude based on number of assignments,
# branches, and conditions.
Metrics/AbcSize:
Enabled: false
Metrics/ClassLength:
Max: 1000 # default 100
# A complexity metric that is strongly correlated to the number
# of test cases needed to validate a method.
Metrics/CyclomaticComplexity:
Enabled: false
# Avoid methods longer than 10 lines of code.
Metrics/MethodLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ModuleLength:
Max: 500 # default 100
# A complexity metric geared towards measuring complexity for a human reader.
Metrics/PerceivedComplexity:
Enabled: false
Metrics/ParameterLists:
Exclude:
- app/models/jupiter_core/search.rb
- app/models/jupiter_core/solr_services/deferred_faceted_solr_query.rb
Minitest/MultipleAssertions:
Enabled: false
Naming/FileName:
Exclude:
- Dangerfile
- Rakefile
- Gemfile
Naming/MemoizedInstanceVariableName:
Exclude:
- app/models/jupiter_core//solr_services/deferred_faceted_solr_query.rb
Naming/MethodParameterName:
Exclude:
- app/models/jupiter_core//solr_services/deferred_faceted_solr_query.rb
- app/models/jupiter_core/search.rb
Rails:
Enabled: true
Rails/SkipsModelValidations:
Exclude:
- app/controllers/aip/v1/collections_controller.rb
- app/controllers/aip/v1/communities_controller.rb
- app/controllers/aip/v1/entities_controller.rb
- app/services/rdf_graph_creation_service.rb
# There comes a point where I question Rubocop's maintainer's sanity
Rails/UnknownEnv:
Enabled: false
Style/ArrayCoercion:
Enabled: false
Style/BarePercentLiterals:
Enabled: false
# indentation is an endangered resource
Style/ClassAndModuleChildren:
EnforcedStyle: compact
Exclude:
- config/application.rb
Style/ClassVars:
Exclude:
- !ruby/regexp /_test\.rb$/
Style/Documentation:
Enabled: false
Style/FormatStringToken:
Enabled: false
# Checks if there is a magic comment to enforce string literals
Style/FrozenStringLiteralComment:
Enabled: false
Style/NumericPredicate:
EnforcedStyle: comparison
Style/MixinUsage:
Exclude:
- bin/setup
- bin/update
# Perfer to use // but %r can be better in certain scenarios
Style/RegexpLiteral:
Enabled: false
Style/SingleLineMethods:
Enabled: false
Style/SymbolArray:
Enabled: true
EnforcedStyle: brackets
Style/TrailingUnderscoreVariable:
Enabled: false
# Use %w or %W for arrays of words.
Style/WordArray:
Enabled: false
Performance/TimesMap:
Enabled: false
Style/ClassEqualityComparison:
Enabled: true
Style/RedundantBegin:
Enabled: true
Exclude:
- bin/yarn
Naming/VariableNumber:
Enabled: false
Style/OpenStructUse:
Exclude:
- config/initializers/controlled_vocabularies.rb
# Migrations are YYYYMMDDHHMMSS rather than a numeric
Style/NumericLiterals:
Exclude:
- config/initializers/strong_migrations.rb