niftany 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/.travis.yml +4 -2
- data/niftany.gemspec +8 -7
- data/niftany_rubocop_ruby.yml +8 -603
- data/rubocop/layout.yml +48 -0
- data/rubocop/lint.yml +103 -0
- data/rubocop/metrics.yml +48 -0
- data/rubocop/naming.yml +29 -0
- data/rubocop/performance.yml +50 -0
- data/rubocop/style.yml +317 -0
- metadata +28 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bf91705f64576fd41a260006215c2b61760a731c5137de5c40445da683ad4eb
|
4
|
+
data.tar.gz: f5ad80dd870b64d68faa74855acb03302117c4e43cfebe9384aa86ab7e51aad0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17409ed3226dbc64b48917632fb7544a7908d0dc695d383654149bdb994ac27a0bb568e3522a61799440ee363f42abdbd59e7e6e6bbd1ae7bc717fff66f34e40
|
7
|
+
data.tar.gz: 76d6ceb812f870ece48526a250aecc429c3567e0b79ff1be42fc103fc68d5c38ca8a3d20aee31c1b1af2570287ac72b16f77c16f7c875e8a81b1b41ad6e0d947
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.3
|
data/.travis.yml
CHANGED
data/niftany.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'niftany'
|
5
|
-
spec.version = '0.
|
5
|
+
spec.version = '0.5.0'
|
6
6
|
spec.authors = ['Adam Wead']
|
7
7
|
spec.email = ['amsterdamos@gmail.com']
|
8
8
|
spec.summary = 'Manages configurations and versions of linters used in projects at '\
|
@@ -13,12 +13,13 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.bindir = 'exe'
|
14
14
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
15
15
|
|
16
|
-
spec.add_dependency 'colorize',
|
17
|
-
spec.add_dependency 'erb_lint',
|
18
|
-
spec.add_dependency 'rubocop',
|
16
|
+
spec.add_dependency 'colorize', '~> 0.8.1'
|
17
|
+
spec.add_dependency 'erb_lint', '~> 0.0.22'
|
18
|
+
spec.add_dependency 'rubocop', '~> 0.61'
|
19
|
+
spec.add_dependency 'rubocop-performance', '~> 1.1'
|
19
20
|
spec.add_dependency 'rubocop-rspec', '~> 1.3'
|
20
|
-
spec.add_dependency 'scss_lint',
|
21
|
+
spec.add_dependency 'scss_lint', '~> 0.55'
|
21
22
|
|
22
|
-
spec.add_development_dependency 'bundler', '~>
|
23
|
-
spec.add_development_dependency 'rake', '~>
|
23
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
24
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
24
25
|
end
|
data/niftany_rubocop_ruby.yml
CHANGED
@@ -1,606 +1,11 @@
|
|
1
1
|
---
|
2
|
+
inherit_from:
|
3
|
+
- rubocop/layout.yml
|
4
|
+
- rubocop/lint.yml
|
5
|
+
- rubocop/metrics.yml
|
6
|
+
- rubocop/naming.yml
|
7
|
+
- rubocop/performance.yml
|
8
|
+
- rubocop/style.yml
|
9
|
+
|
2
10
|
AllCops:
|
3
11
|
DisplayCopNames: true
|
4
|
-
|
5
|
-
Naming/AccessorMethodName:
|
6
|
-
Description: Check the naming of accessor methods for get_/set_.
|
7
|
-
Enabled: true
|
8
|
-
|
9
|
-
Style/Alias:
|
10
|
-
Description: 'Use alias_method instead of alias.'
|
11
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
12
|
-
Enabled: false
|
13
|
-
|
14
|
-
Style/ArrayJoin:
|
15
|
-
Description: 'Use Array#join instead of Array#*.'
|
16
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
17
|
-
Enabled: false
|
18
|
-
|
19
|
-
Style/AsciiComments:
|
20
|
-
Description: 'Use only ascii symbols in comments.'
|
21
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
Naming/AsciiIdentifiers:
|
25
|
-
Description: 'Use only ascii symbols in identifiers.'
|
26
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
27
|
-
Enabled: false
|
28
|
-
|
29
|
-
Style/Attr:
|
30
|
-
Description: 'Checks for uses of Module#attr.'
|
31
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
32
|
-
Enabled: false
|
33
|
-
|
34
|
-
Metrics/BlockNesting:
|
35
|
-
Description: 'Avoid excessive block nesting'
|
36
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
37
|
-
Enabled: false
|
38
|
-
|
39
|
-
Style/BracesAroundHashParameters:
|
40
|
-
Description: >-
|
41
|
-
Checks for braces around the last parameter in a method call if the last parameter is a hash.
|
42
|
-
It supports 3 styles: braces, no_braces, context_dependent
|
43
|
-
Enabled: true
|
44
|
-
|
45
|
-
Style/CaseEquality:
|
46
|
-
Description: 'Avoid explicit use of the case equality operator(===).'
|
47
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
48
|
-
Enabled: false
|
49
|
-
|
50
|
-
Style/CharacterLiteral:
|
51
|
-
Description: 'Checks for uses of character literals.'
|
52
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
Style/ClassAndModuleChildren:
|
56
|
-
Description: 'Checks style of children classes and modules.'
|
57
|
-
Enabled: false
|
58
|
-
|
59
|
-
Metrics/ClassLength:
|
60
|
-
Description: 'Avoid classes longer than 100 lines of code.'
|
61
|
-
Enabled: true
|
62
|
-
|
63
|
-
Metrics/ModuleLength:
|
64
|
-
Description: 'Avoid modules longer than 100 lines of code.'
|
65
|
-
Enabled: false
|
66
|
-
|
67
|
-
Style/ClassVars:
|
68
|
-
Description: 'Avoid the use of class variables.'
|
69
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
70
|
-
Enabled: true
|
71
|
-
|
72
|
-
Style/CollectionMethods:
|
73
|
-
Enabled: true
|
74
|
-
PreferredMethods:
|
75
|
-
inject: reduce
|
76
|
-
collect: map
|
77
|
-
collect!: map!
|
78
|
-
find_all: select
|
79
|
-
detect: find
|
80
|
-
|
81
|
-
Style/ColonMethodCall:
|
82
|
-
Description: 'Do not use :: for method call.'
|
83
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
84
|
-
Enabled: false
|
85
|
-
|
86
|
-
Style/CommentAnnotation:
|
87
|
-
Description: >-
|
88
|
-
Checks formatting of special comments
|
89
|
-
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
90
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
91
|
-
Enabled: false
|
92
|
-
|
93
|
-
Metrics/AbcSize:
|
94
|
-
Description: >-
|
95
|
-
A calculated magnitude based on number of assignments,
|
96
|
-
branches, and conditions.
|
97
|
-
Enabled: false
|
98
|
-
|
99
|
-
Metrics/CyclomaticComplexity:
|
100
|
-
Description: >-
|
101
|
-
A complexity metric that is strongly correlated to the number
|
102
|
-
of test cases needed to validate a method.
|
103
|
-
Enabled: true
|
104
|
-
|
105
|
-
Metrics/PerceivedComplexity:
|
106
|
-
Description: >-
|
107
|
-
This cop tries to produce a complexity score that's a measure of the complexity
|
108
|
-
the reader experiences when looking at a method
|
109
|
-
Enabled: true
|
110
|
-
|
111
|
-
Style/Documentation:
|
112
|
-
Description: 'Document classes and non-namespace modules.'
|
113
|
-
Enabled: false
|
114
|
-
|
115
|
-
Style/DoubleNegation:
|
116
|
-
Description: 'Checks for uses of double negation (!!).'
|
117
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
118
|
-
Enabled: false
|
119
|
-
|
120
|
-
Style/EachWithObject:
|
121
|
-
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
122
|
-
Enabled: false
|
123
|
-
|
124
|
-
Style/EmptyLiteral:
|
125
|
-
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
126
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
127
|
-
Enabled: false
|
128
|
-
|
129
|
-
# Checks whether the source file has a utf-8 encoding comment or not
|
130
|
-
# AutoCorrectEncodingComment must match the regex
|
131
|
-
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
132
|
-
Style/Encoding:
|
133
|
-
Enabled: false
|
134
|
-
|
135
|
-
Style/EvenOdd:
|
136
|
-
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
137
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
138
|
-
Enabled: false
|
139
|
-
|
140
|
-
Naming/FileName:
|
141
|
-
Description: 'Use snake_case for source file names.'
|
142
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
143
|
-
Enabled: false
|
144
|
-
|
145
|
-
Style/FrozenStringLiteralComment:
|
146
|
-
Description: >-
|
147
|
-
Add the frozen_string_literal comment to the top of files
|
148
|
-
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
149
|
-
Enabled: true
|
150
|
-
|
151
|
-
Style/FlipFlop:
|
152
|
-
Description: 'Checks for flip flops'
|
153
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
154
|
-
Enabled: false
|
155
|
-
|
156
|
-
Style/FormatString:
|
157
|
-
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
158
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
159
|
-
Enabled: false
|
160
|
-
|
161
|
-
Style/GlobalVars:
|
162
|
-
Description: 'Do not introduce global variables.'
|
163
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
164
|
-
Enabled: true
|
165
|
-
|
166
|
-
Style/GuardClause:
|
167
|
-
Description: 'Check for conditionals that can be replaced with guard clauses'
|
168
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
169
|
-
Enabled: false
|
170
|
-
|
171
|
-
Style/IfUnlessModifier:
|
172
|
-
Description: >-
|
173
|
-
Favor modifier if/unless usage when you have a
|
174
|
-
single-line body.
|
175
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
176
|
-
Enabled: false
|
177
|
-
|
178
|
-
Style/IfWithSemicolon:
|
179
|
-
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
180
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
181
|
-
Enabled: false
|
182
|
-
|
183
|
-
Layout/IndentationConsistency:
|
184
|
-
Description: 'Checks for inconsistent indentation.'
|
185
|
-
EnforcedStyle: rails
|
186
|
-
|
187
|
-
Style/InlineComment:
|
188
|
-
Description: 'Avoid inline comments.'
|
189
|
-
Enabled: false
|
190
|
-
|
191
|
-
Style/Lambda:
|
192
|
-
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
193
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
194
|
-
Enabled: false
|
195
|
-
|
196
|
-
Style/LambdaCall:
|
197
|
-
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
198
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
199
|
-
Enabled: false
|
200
|
-
|
201
|
-
Style/LineEndConcatenation:
|
202
|
-
Description: >-
|
203
|
-
Use \ instead of + or << to concatenate two string literals at
|
204
|
-
line end.
|
205
|
-
Enabled: false
|
206
|
-
|
207
|
-
# Override style guide to allow length of up to 120 characters.
|
208
|
-
Metrics/LineLength:
|
209
|
-
Description: 'Limit lines to 120 characters.'
|
210
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
211
|
-
Enabled: true
|
212
|
-
Max: 120
|
213
|
-
|
214
|
-
Metrics/MethodLength:
|
215
|
-
Description: 'Avoid methods longer than 10 lines of code.'
|
216
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
217
|
-
Enabled: false
|
218
|
-
|
219
|
-
Style/ModuleFunction:
|
220
|
-
Description: 'Checks for usage of `extend self` in modules.'
|
221
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
222
|
-
Enabled: false
|
223
|
-
|
224
|
-
Style/MultilineBlockChain:
|
225
|
-
Description: 'Avoid multi-line chains of blocks.'
|
226
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
227
|
-
Enabled: false
|
228
|
-
|
229
|
-
Layout/MultilineBlockLayout:
|
230
|
-
Description: 'Checks whether the multiline do end blocks have a newline after the start of the block.'
|
231
|
-
Enabled: true
|
232
|
-
|
233
|
-
Style/NegatedIf:
|
234
|
-
Description: >-
|
235
|
-
Favor unless over if for negative conditions
|
236
|
-
(or control flow or).
|
237
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
238
|
-
Enabled: false
|
239
|
-
|
240
|
-
Style/NegatedWhile:
|
241
|
-
Description: 'Favor until over while for negative conditions.'
|
242
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
243
|
-
Enabled: false
|
244
|
-
|
245
|
-
Style/Next:
|
246
|
-
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
247
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
248
|
-
Enabled: false
|
249
|
-
|
250
|
-
Style/NilComparison:
|
251
|
-
Description: 'Prefer x.nil? to x == nil.'
|
252
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
253
|
-
Enabled: false
|
254
|
-
|
255
|
-
Style/Not:
|
256
|
-
Description: 'Use ! instead of not.'
|
257
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
258
|
-
Enabled: false
|
259
|
-
|
260
|
-
Style/NumericLiterals:
|
261
|
-
Description: >-
|
262
|
-
Add underscores to large numeric literals to improve their
|
263
|
-
readability.
|
264
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
265
|
-
Enabled: false
|
266
|
-
|
267
|
-
Style/OneLineConditional:
|
268
|
-
Description: >-
|
269
|
-
Favor the ternary operator(?:) over
|
270
|
-
if/then/else/end constructs.
|
271
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
272
|
-
Enabled: false
|
273
|
-
|
274
|
-
Naming/BinaryOperatorParameterName:
|
275
|
-
Description: 'When defining binary operators, name the argument other.'
|
276
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
277
|
-
Enabled: false
|
278
|
-
|
279
|
-
Metrics/ParameterLists:
|
280
|
-
Description: 'Avoid parameter lists longer than three or four parameters.'
|
281
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
282
|
-
Enabled: false
|
283
|
-
|
284
|
-
Style/PercentLiteralDelimiters:
|
285
|
-
Description: 'Use `%`-literal delimiters consistently'
|
286
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
287
|
-
Enabled: false
|
288
|
-
|
289
|
-
Style/PerlBackrefs:
|
290
|
-
Description: 'Avoid Perl-style regex back references.'
|
291
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
292
|
-
Enabled: false
|
293
|
-
|
294
|
-
Naming/PredicateName:
|
295
|
-
Description: 'Check the names of predicate methods.'
|
296
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
297
|
-
NamePrefixBlacklist:
|
298
|
-
- is_
|
299
|
-
|
300
|
-
Style/Proc:
|
301
|
-
Description: 'Use proc instead of Proc.new.'
|
302
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
303
|
-
Enabled: false
|
304
|
-
|
305
|
-
Style/RaiseArgs:
|
306
|
-
Description: 'Checks the arguments passed to raise/fail.'
|
307
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
308
|
-
Enabled: false
|
309
|
-
|
310
|
-
Style/RegexpLiteral:
|
311
|
-
Description: 'Use / or %r around regular expressions.'
|
312
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
313
|
-
Enabled: false
|
314
|
-
|
315
|
-
Style/SelfAssignment:
|
316
|
-
Description: >-
|
317
|
-
Checks for places where self-assignment shorthand should have
|
318
|
-
been used.
|
319
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
320
|
-
Enabled: false
|
321
|
-
|
322
|
-
Style/SingleLineBlockParams:
|
323
|
-
Description: 'Enforces the names of some block params.'
|
324
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
325
|
-
Enabled: false
|
326
|
-
|
327
|
-
Style/SingleLineMethods:
|
328
|
-
Description: 'Avoid single-line methods.'
|
329
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
330
|
-
Enabled: false
|
331
|
-
|
332
|
-
Style/SignalException:
|
333
|
-
Description: 'Checks for proper usage of fail and raise.'
|
334
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
335
|
-
Enabled: false
|
336
|
-
|
337
|
-
Style/SpecialGlobalVars:
|
338
|
-
Description: 'Avoid Perl-style global variables.'
|
339
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
340
|
-
Enabled: false
|
341
|
-
|
342
|
-
Style/StringLiterals:
|
343
|
-
Description: 'Checks if uses of quotes match the configured preference.'
|
344
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
345
|
-
EnforcedStyle: single_quotes
|
346
|
-
Enabled: true
|
347
|
-
|
348
|
-
Style/TrailingCommaInArguments:
|
349
|
-
Description: >-
|
350
|
-
Checks for trailing comma in argument lists. Supported styles are:
|
351
|
-
comma
|
352
|
-
consistent_comma
|
353
|
-
no_comma
|
354
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
355
|
-
EnforcedStyleForMultiline: no_comma
|
356
|
-
Enabled: true
|
357
|
-
|
358
|
-
Style/TrailingCommaInArrayLiteral:
|
359
|
-
Description: >-
|
360
|
-
Checks for trailing comma in array and hash literals. Supported styles are:
|
361
|
-
comma
|
362
|
-
consistent_comma
|
363
|
-
no_comma
|
364
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
365
|
-
EnforcedStyleForMultiline: no_comma
|
366
|
-
Enabled: true
|
367
|
-
|
368
|
-
Style/TrivialAccessors:
|
369
|
-
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
370
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
371
|
-
Enabled: false
|
372
|
-
|
373
|
-
Lint/UselessAssignment:
|
374
|
-
Description: >-
|
375
|
-
Checks for every useless assignment to local variable in every scope.
|
376
|
-
The basic idea for this cop was from the warning of `ruby -cw`:'
|
377
|
-
Enabled: true
|
378
|
-
|
379
|
-
Naming/VariableName:
|
380
|
-
Description: 'Makes sure that all variables use the configured style, snake_case or camelCase, for their names.'
|
381
|
-
Enabled: true
|
382
|
-
|
383
|
-
Style/VariableInterpolation:
|
384
|
-
Description: >-
|
385
|
-
Don't interpolate global, instance and class variables
|
386
|
-
directly in strings.
|
387
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
388
|
-
Enabled: false
|
389
|
-
|
390
|
-
Style/WhenThen:
|
391
|
-
Description: 'Use when x then ... for one-line cases.'
|
392
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
393
|
-
Enabled: false
|
394
|
-
|
395
|
-
Style/WhileUntilModifier:
|
396
|
-
Description: >-
|
397
|
-
Favor modifier while/until usage when you have a
|
398
|
-
single-line body.
|
399
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
400
|
-
Enabled: false
|
401
|
-
|
402
|
-
Style/WordArray:
|
403
|
-
Description: 'Use %w or %W for arrays of words.'
|
404
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
405
|
-
Enabled: false
|
406
|
-
|
407
|
-
# Layout
|
408
|
-
|
409
|
-
Layout/AlignParameters:
|
410
|
-
Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
|
411
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
412
|
-
Enabled: false
|
413
|
-
|
414
|
-
Layout/DotPosition:
|
415
|
-
Description: 'Checks the position of the dot in multi-line method calls.'
|
416
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
417
|
-
EnforcedStyle: leading
|
418
|
-
|
419
|
-
Layout/ExtraSpacing:
|
420
|
-
Description: 'Do not use unnecessary spacing.'
|
421
|
-
Enabled: true
|
422
|
-
|
423
|
-
Layout/MultilineOperationIndentation:
|
424
|
-
Description: >-
|
425
|
-
Checks indentation of binary operations that span more than
|
426
|
-
one line.
|
427
|
-
Enabled: true
|
428
|
-
EnforcedStyle: indented
|
429
|
-
|
430
|
-
Layout/MultilineMethodCallIndentation:
|
431
|
-
Description: >-
|
432
|
-
Checks indentation of method calls with the dot operator
|
433
|
-
that span more than one line.
|
434
|
-
Enabled: true
|
435
|
-
EnforcedStyle: indented
|
436
|
-
|
437
|
-
Layout/InitialIndentation:
|
438
|
-
Description: >-
|
439
|
-
Checks the indentation of the first non-blank non-comment line in a file.
|
440
|
-
Enabled: false
|
441
|
-
|
442
|
-
Style/SymbolArray:
|
443
|
-
Description: This cop checks for array literals made up of symbols that are not using the %i() syntax.
|
444
|
-
Enabled: false
|
445
|
-
|
446
|
-
Style/SymbolArray:
|
447
|
-
Description: This cop checks for array literals made up of symbols that are not using the %i() syntax.
|
448
|
-
Enabled: false
|
449
|
-
|
450
|
-
# Lint
|
451
|
-
|
452
|
-
Lint/AmbiguousOperator:
|
453
|
-
Description: >-
|
454
|
-
Checks for ambiguous operators in the first argument of a
|
455
|
-
method invocation without parentheses.
|
456
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
457
|
-
Enabled: false
|
458
|
-
|
459
|
-
Lint/AmbiguousRegexpLiteral:
|
460
|
-
Description: >-
|
461
|
-
Checks for ambiguous regexp literals in the first argument of
|
462
|
-
a method invocation without parenthesis.
|
463
|
-
Enabled: false
|
464
|
-
|
465
|
-
Lint/AssignmentInCondition:
|
466
|
-
Description: "Don't use assignment in conditions."
|
467
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
468
|
-
Enabled: false
|
469
|
-
|
470
|
-
Lint/CircularArgumentReference:
|
471
|
-
Description: "Don't refer to the keyword argument in the default value."
|
472
|
-
Enabled: false
|
473
|
-
|
474
|
-
Layout/ConditionPosition:
|
475
|
-
Description: >-
|
476
|
-
Checks for condition placed in a confusing position relative to
|
477
|
-
the keyword.
|
478
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
479
|
-
Enabled: false
|
480
|
-
|
481
|
-
Lint/DeprecatedClassMethods:
|
482
|
-
Description: 'Check for deprecated class method calls.'
|
483
|
-
Enabled: false
|
484
|
-
|
485
|
-
Lint/DuplicatedKey:
|
486
|
-
Description: 'Check for duplicate keys in hash literals.'
|
487
|
-
Enabled: true
|
488
|
-
|
489
|
-
Lint/EachWithObjectArgument:
|
490
|
-
Description: 'Check for immutable argument given to each_with_object.'
|
491
|
-
Enabled: false
|
492
|
-
|
493
|
-
Lint/ElseLayout:
|
494
|
-
Description: 'Check for odd code arrangement in an else block.'
|
495
|
-
Enabled: false
|
496
|
-
|
497
|
-
Lint/FormatParameterMismatch:
|
498
|
-
Description: 'The number of parameters to format/sprint must match the fields.'
|
499
|
-
Enabled: false
|
500
|
-
|
501
|
-
Lint/HandleExceptions:
|
502
|
-
Description: "Don't suppress exception."
|
503
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
504
|
-
Enabled: false
|
505
|
-
|
506
|
-
Lint/LiteralAsCondition:
|
507
|
-
Description: 'Checks of literals used in conditions.'
|
508
|
-
Enabled: true
|
509
|
-
|
510
|
-
Lint/LiteralInInterpolation:
|
511
|
-
Description: 'Checks for literals used in interpolation.'
|
512
|
-
Enabled: false
|
513
|
-
|
514
|
-
Lint/Loop:
|
515
|
-
Description: >-
|
516
|
-
Use Kernel#loop with break rather than begin/end/until or
|
517
|
-
begin/end/while for post-loop tests.
|
518
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
519
|
-
Enabled: false
|
520
|
-
|
521
|
-
Lint/NestedMethodDefinition:
|
522
|
-
Description: 'Do not use nested method definitions.'
|
523
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
524
|
-
Enabled: false
|
525
|
-
|
526
|
-
Lint/NonLocalExitFromIterator:
|
527
|
-
Description: 'Do not use return in iterator to cause non-local exit.'
|
528
|
-
Enabled: false
|
529
|
-
|
530
|
-
Lint/ParenthesesAsGroupedExpression:
|
531
|
-
Description: >-
|
532
|
-
Checks for method calls with a space before the opening
|
533
|
-
parenthesis.
|
534
|
-
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
535
|
-
Enabled: false
|
536
|
-
|
537
|
-
Lint/RequireParentheses:
|
538
|
-
Description: >-
|
539
|
-
Use parentheses in the method call to avoid confusion
|
540
|
-
about precedence.
|
541
|
-
Enabled: false
|
542
|
-
|
543
|
-
Lint/UnderscorePrefixedVariableName:
|
544
|
-
Description: 'Do not use prefix `_` for a variable that is used.'
|
545
|
-
Enabled: false
|
546
|
-
|
547
|
-
Lint/Void:
|
548
|
-
Description: 'Possible use of operator/literal/variable in void context.'
|
549
|
-
Enabled: false
|
550
|
-
|
551
|
-
# Performance
|
552
|
-
|
553
|
-
Performance/CaseWhenSplat:
|
554
|
-
Description: >-
|
555
|
-
Place `when` conditions that use splat at the end
|
556
|
-
of the list of `when` branches.
|
557
|
-
Enabled: false
|
558
|
-
|
559
|
-
Performance/Count:
|
560
|
-
Description: >-
|
561
|
-
Use `count` instead of `select...size`, `reject...size`,
|
562
|
-
`select...count`, `reject...count`, `select...length`,
|
563
|
-
and `reject...length`.
|
564
|
-
Enabled: false
|
565
|
-
|
566
|
-
Performance/Detect:
|
567
|
-
Description: >-
|
568
|
-
Use `detect` instead of `select.first`, `find_all.first`,
|
569
|
-
`select.last`, and `find_all.last`.
|
570
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
571
|
-
Enabled: false
|
572
|
-
|
573
|
-
Performance/FlatMap:
|
574
|
-
Description: >-
|
575
|
-
Use `Enumerable#flat_map`
|
576
|
-
instead of `Enumerable#map...Array#flatten(1)`
|
577
|
-
or `Enumberable#collect..Array#flatten(1)`
|
578
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
579
|
-
Enabled: false
|
580
|
-
|
581
|
-
Performance/ReverseEach:
|
582
|
-
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
583
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
584
|
-
Enabled: false
|
585
|
-
|
586
|
-
Performance/Sample:
|
587
|
-
Description: >-
|
588
|
-
Use `sample` instead of `shuffle.first`,
|
589
|
-
`shuffle.last`, and `shuffle[Fixnum]`.
|
590
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
591
|
-
Enabled: false
|
592
|
-
|
593
|
-
Performance/Size:
|
594
|
-
Description: >-
|
595
|
-
Use `size` instead of `count` for counting
|
596
|
-
the number of elements in `Array` and `Hash`.
|
597
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
598
|
-
Enabled: false
|
599
|
-
|
600
|
-
Performance/StringReplacement:
|
601
|
-
Description: >-
|
602
|
-
Use `tr` instead of `gsub` when you are replacing the same
|
603
|
-
number of characters. Use `delete` instead of `gsub` when
|
604
|
-
you are deleting characters.
|
605
|
-
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
606
|
-
Enabled: false
|
data/rubocop/layout.yml
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
Layout/AlignParameters:
|
3
|
+
Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
|
4
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Layout/DotPosition:
|
8
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
9
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
10
|
+
EnforcedStyle: leading
|
11
|
+
|
12
|
+
Layout/ExtraSpacing:
|
13
|
+
Description: 'Do not use unnecessary spacing.'
|
14
|
+
Enabled: true
|
15
|
+
|
16
|
+
Layout/MultilineOperationIndentation:
|
17
|
+
Description: >-
|
18
|
+
Checks indentation of binary operations that span more than
|
19
|
+
one line.
|
20
|
+
Enabled: true
|
21
|
+
EnforcedStyle: indented
|
22
|
+
|
23
|
+
Layout/MultilineMethodCallIndentation:
|
24
|
+
Description: >-
|
25
|
+
Checks indentation of method calls with the dot operator
|
26
|
+
that span more than one line.
|
27
|
+
Enabled: true
|
28
|
+
EnforcedStyle: indented
|
29
|
+
|
30
|
+
Layout/InitialIndentation:
|
31
|
+
Description: >-
|
32
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Layout/ConditionPosition:
|
36
|
+
Description: >-
|
37
|
+
Checks for condition placed in a confusing position relative to
|
38
|
+
the keyword.
|
39
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Layout/IndentationConsistency:
|
43
|
+
Description: 'Checks for inconsistent indentation.'
|
44
|
+
EnforcedStyle: rails
|
45
|
+
|
46
|
+
Layout/MultilineBlockLayout:
|
47
|
+
Description: 'Checks whether the multiline do end blocks have a newline after the start of the block.'
|
48
|
+
Enabled: true
|
data/rubocop/lint.yml
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
---
|
2
|
+
Lint/AmbiguousOperator:
|
3
|
+
Description: >-
|
4
|
+
Checks for ambiguous operators in the first argument of a
|
5
|
+
method invocation without parentheses.
|
6
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
7
|
+
Enabled: false
|
8
|
+
|
9
|
+
Lint/AmbiguousRegexpLiteral:
|
10
|
+
Description: >-
|
11
|
+
Checks for ambiguous regexp literals in the first argument of
|
12
|
+
a method invocation without parenthesis.
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Lint/AssignmentInCondition:
|
16
|
+
Description: "Don't use assignment in conditions."
|
17
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
Lint/CircularArgumentReference:
|
21
|
+
Description: "Don't refer to the keyword argument in the default value."
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Lint/DeprecatedClassMethods:
|
25
|
+
Description: 'Check for deprecated class method calls.'
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Lint/DuplicatedKey:
|
29
|
+
Description: 'Check for duplicate keys in hash literals.'
|
30
|
+
Enabled: true
|
31
|
+
|
32
|
+
Lint/EachWithObjectArgument:
|
33
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Lint/ElseLayout:
|
37
|
+
Description: 'Check for odd code arrangement in an else block.'
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Lint/FormatParameterMismatch:
|
41
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Lint/HandleExceptions:
|
45
|
+
Description: "Don't suppress exception."
|
46
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Lint/LiteralAsCondition:
|
50
|
+
Description: 'Checks of literals used in conditions.'
|
51
|
+
Enabled: true
|
52
|
+
|
53
|
+
Lint/LiteralInInterpolation:
|
54
|
+
Description: 'Checks for literals used in interpolation.'
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
Lint/Loop:
|
58
|
+
Description: >-
|
59
|
+
Use Kernel#loop with break rather than begin/end/until or
|
60
|
+
begin/end/while for post-loop tests.
|
61
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Lint/NestedMethodDefinition:
|
65
|
+
Description: 'Do not use nested method definitions.'
|
66
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Lint/NonLocalExitFromIterator:
|
70
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
Lint/ParenthesesAsGroupedExpression:
|
74
|
+
Description: >-
|
75
|
+
Checks for method calls with a space before the opening
|
76
|
+
parenthesis.
|
77
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
78
|
+
Enabled: false
|
79
|
+
|
80
|
+
Lint/RequireParentheses:
|
81
|
+
Description: >-
|
82
|
+
Use parentheses in the method call to avoid confusion
|
83
|
+
about precedence.
|
84
|
+
Enabled: false
|
85
|
+
|
86
|
+
Lint/UnderscorePrefixedVariableName:
|
87
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
Lint/Void:
|
91
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
Lint/FlipFlop:
|
95
|
+
Description: 'Checks for flip flops'
|
96
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
Lint/UselessAssignment:
|
100
|
+
Description: >-
|
101
|
+
Checks for every useless assignment to local variable in every scope.
|
102
|
+
The basic idea for this cop was from the warning of `ruby -cw`:'
|
103
|
+
Enabled: true
|
data/rubocop/metrics.yml
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
Metrics/BlockNesting:
|
3
|
+
Description: 'Avoid excessive block nesting'
|
4
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Metrics/ClassLength:
|
8
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
9
|
+
Enabled: true
|
10
|
+
|
11
|
+
Metrics/ModuleLength:
|
12
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
Metrics/AbcSize:
|
16
|
+
Description: >-
|
17
|
+
A calculated magnitude based on number of assignments,
|
18
|
+
branches, and conditions.
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Metrics/CyclomaticComplexity:
|
22
|
+
Description: >-
|
23
|
+
A complexity metric that is strongly correlated to the number
|
24
|
+
of test cases needed to validate a method.
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
Metrics/PerceivedComplexity:
|
28
|
+
Description: >-
|
29
|
+
This cop tries to produce a complexity score that's a measure of the complexity
|
30
|
+
the reader experiences when looking at a method
|
31
|
+
Enabled: true
|
32
|
+
|
33
|
+
# Override style guide to allow length of up to 120 characters.
|
34
|
+
Metrics/LineLength:
|
35
|
+
Description: 'Limit lines to 120 characters.'
|
36
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
37
|
+
Enabled: true
|
38
|
+
Max: 120
|
39
|
+
|
40
|
+
Metrics/MethodLength:
|
41
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
42
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Metrics/ParameterLists:
|
46
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
47
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
48
|
+
Enabled: false
|
data/rubocop/naming.yml
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
Naming/AccessorMethodName:
|
3
|
+
Description: Check the naming of accessor methods for get_/set_.
|
4
|
+
Enabled: true
|
5
|
+
|
6
|
+
Naming/AsciiIdentifiers:
|
7
|
+
Description: 'Use only ascii symbols in identifiers.'
|
8
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Naming/FileName:
|
12
|
+
Description: 'Use snake_case for source file names.'
|
13
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Naming/BinaryOperatorParameterName:
|
17
|
+
Description: 'When defining binary operators, name the argument other.'
|
18
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Naming/PredicateName:
|
22
|
+
Description: 'Check the names of predicate methods.'
|
23
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
24
|
+
NamePrefixBlacklist:
|
25
|
+
- is_
|
26
|
+
|
27
|
+
Naming/VariableName:
|
28
|
+
Description: 'Makes sure that all variables use the configured style, snake_case or camelCase, for their names.'
|
29
|
+
Enabled: true
|
@@ -0,0 +1,50 @@
|
|
1
|
+
---
|
2
|
+
require: rubocop-performance
|
3
|
+
|
4
|
+
Performance/CaseWhenSplat:
|
5
|
+
Description: >-
|
6
|
+
Place `when` conditions that use splat at the end
|
7
|
+
of the list of `when` branches.
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Performance/Count:
|
11
|
+
Description: >-
|
12
|
+
Use `count` instead of `select...size`, `reject...size`,
|
13
|
+
`select...count`, `reject...count`, `select...length`,
|
14
|
+
and `reject...length`.
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Performance/Detect:
|
18
|
+
Description: >-
|
19
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
20
|
+
`select.last`, and `find_all.last`.
|
21
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Performance/FlatMap:
|
25
|
+
Description: >-
|
26
|
+
Use `Enumerable#flat_map`
|
27
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
28
|
+
or `Enumberable#collect..Array#flatten(1)`
|
29
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Performance/ReverseEach:
|
33
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
34
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Performance/Size:
|
38
|
+
Description: >-
|
39
|
+
Use `size` instead of `count` for counting
|
40
|
+
the number of elements in `Array` and `Hash`.
|
41
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Performance/StringReplacement:
|
45
|
+
Description: >-
|
46
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
47
|
+
number of characters. Use `delete` instead of `gsub` when
|
48
|
+
you are deleting characters.
|
49
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
50
|
+
Enabled: false
|
data/rubocop/style.yml
ADDED
@@ -0,0 +1,317 @@
|
|
1
|
+
---
|
2
|
+
Style/Alias:
|
3
|
+
Description: 'Use alias_method instead of alias.'
|
4
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Style/ArrayJoin:
|
8
|
+
Description: 'Use Array#join instead of Array#*.'
|
9
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
Style/AsciiComments:
|
13
|
+
Description: 'Use only ascii symbols in comments.'
|
14
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Style/Attr:
|
18
|
+
Description: 'Checks for uses of Module#attr.'
|
19
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/BracesAroundHashParameters:
|
23
|
+
Description: >-
|
24
|
+
Checks for braces around the last parameter in a method call if the last parameter is a hash.
|
25
|
+
It supports 3 styles: braces, no_braces, context_dependent
|
26
|
+
Enabled: true
|
27
|
+
|
28
|
+
Style/CaseEquality:
|
29
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
30
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Style/CharacterLiteral:
|
34
|
+
Description: 'Checks for uses of character literals.'
|
35
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Style/ClassAndModuleChildren:
|
39
|
+
Description: 'Checks style of children classes and modules.'
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/ClassVars:
|
43
|
+
Description: 'Avoid the use of class variables.'
|
44
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
45
|
+
Enabled: true
|
46
|
+
|
47
|
+
Style/CollectionMethods:
|
48
|
+
Enabled: true
|
49
|
+
PreferredMethods:
|
50
|
+
inject: reduce
|
51
|
+
collect: map
|
52
|
+
collect!: map!
|
53
|
+
find_all: select
|
54
|
+
detect: find
|
55
|
+
|
56
|
+
Style/ColonMethodCall:
|
57
|
+
Description: 'Do not use :: for method call.'
|
58
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
59
|
+
Enabled: false
|
60
|
+
|
61
|
+
Style/CommentAnnotation:
|
62
|
+
Description: >-
|
63
|
+
Checks formatting of special comments
|
64
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
65
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
Style/Documentation:
|
69
|
+
Description: 'Document classes and non-namespace modules.'
|
70
|
+
Enabled: false
|
71
|
+
|
72
|
+
Style/DoubleNegation:
|
73
|
+
Description: 'Checks for uses of double negation (!!).'
|
74
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
75
|
+
Enabled: false
|
76
|
+
|
77
|
+
Style/EachWithObject:
|
78
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
Style/EmptyLiteral:
|
82
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
83
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
84
|
+
Enabled: false
|
85
|
+
|
86
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
87
|
+
# AutoCorrectEncodingComment must match the regex
|
88
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
89
|
+
Style/Encoding:
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
Style/EvenOdd:
|
93
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
94
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
95
|
+
Enabled: false
|
96
|
+
|
97
|
+
Style/FrozenStringLiteralComment:
|
98
|
+
Description: >-
|
99
|
+
Add the frozen_string_literal comment to the top of files
|
100
|
+
to help transition from Ruby 2.3.0 to Ruby 3.0.
|
101
|
+
Enabled: true
|
102
|
+
|
103
|
+
Style/FormatString:
|
104
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
105
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
Style/GlobalVars:
|
109
|
+
Description: 'Do not introduce global variables.'
|
110
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
111
|
+
Enabled: true
|
112
|
+
|
113
|
+
Style/GuardClause:
|
114
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
115
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
116
|
+
Enabled: false
|
117
|
+
|
118
|
+
Style/IfUnlessModifier:
|
119
|
+
Description: >-
|
120
|
+
Favor modifier if/unless usage when you have a
|
121
|
+
single-line body.
|
122
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
123
|
+
Enabled: false
|
124
|
+
|
125
|
+
Style/IfWithSemicolon:
|
126
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
127
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
128
|
+
Enabled: false
|
129
|
+
|
130
|
+
Style/InlineComment:
|
131
|
+
Description: 'Avoid inline comments.'
|
132
|
+
Enabled: false
|
133
|
+
|
134
|
+
Style/Lambda:
|
135
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
136
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
137
|
+
Enabled: false
|
138
|
+
|
139
|
+
Style/LambdaCall:
|
140
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
141
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
142
|
+
Enabled: false
|
143
|
+
|
144
|
+
Style/LineEndConcatenation:
|
145
|
+
Description: >-
|
146
|
+
Use \ instead of + or << to concatenate two string literals at
|
147
|
+
line end.
|
148
|
+
Enabled: false
|
149
|
+
|
150
|
+
Style/ModuleFunction:
|
151
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
152
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
153
|
+
Enabled: false
|
154
|
+
|
155
|
+
Style/MultilineBlockChain:
|
156
|
+
Description: 'Avoid multi-line chains of blocks.'
|
157
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
158
|
+
Enabled: false
|
159
|
+
|
160
|
+
Style/NegatedIf:
|
161
|
+
Description: >-
|
162
|
+
Favor unless over if for negative conditions
|
163
|
+
(or control flow or).
|
164
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
165
|
+
Enabled: false
|
166
|
+
|
167
|
+
Style/NegatedWhile:
|
168
|
+
Description: 'Favor until over while for negative conditions.'
|
169
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
Style/Next:
|
173
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
174
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
175
|
+
Enabled: false
|
176
|
+
|
177
|
+
Style/NilComparison:
|
178
|
+
Description: 'Prefer x.nil? to x == nil.'
|
179
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
180
|
+
Enabled: false
|
181
|
+
|
182
|
+
Style/Not:
|
183
|
+
Description: 'Use ! instead of not.'
|
184
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
185
|
+
Enabled: false
|
186
|
+
|
187
|
+
Style/NumericLiterals:
|
188
|
+
Description: >-
|
189
|
+
Add underscores to large numeric literals to improve their
|
190
|
+
readability.
|
191
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
192
|
+
Enabled: false
|
193
|
+
|
194
|
+
Style/OneLineConditional:
|
195
|
+
Description: >-
|
196
|
+
Favor the ternary operator(?:) over
|
197
|
+
if/then/else/end constructs.
|
198
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
199
|
+
Enabled: false
|
200
|
+
|
201
|
+
Style/PercentLiteralDelimiters:
|
202
|
+
Description: 'Use `%`-literal delimiters consistently'
|
203
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
204
|
+
Enabled: false
|
205
|
+
|
206
|
+
Style/PerlBackrefs:
|
207
|
+
Description: 'Avoid Perl-style regex back references.'
|
208
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
209
|
+
Enabled: false
|
210
|
+
|
211
|
+
Style/Proc:
|
212
|
+
Description: 'Use proc instead of Proc.new.'
|
213
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
214
|
+
Enabled: false
|
215
|
+
|
216
|
+
Style/RaiseArgs:
|
217
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
218
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
219
|
+
Enabled: false
|
220
|
+
|
221
|
+
Style/RegexpLiteral:
|
222
|
+
Description: 'Use / or %r around regular expressions.'
|
223
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
224
|
+
Enabled: false
|
225
|
+
|
226
|
+
Style/SelfAssignment:
|
227
|
+
Description: >-
|
228
|
+
Checks for places where self-assignment shorthand should have
|
229
|
+
been used.
|
230
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
231
|
+
Enabled: false
|
232
|
+
|
233
|
+
Style/SingleLineBlockParams:
|
234
|
+
Description: 'Enforces the names of some block params.'
|
235
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
236
|
+
Enabled: false
|
237
|
+
|
238
|
+
Style/SingleLineMethods:
|
239
|
+
Description: 'Avoid single-line methods.'
|
240
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
241
|
+
Enabled: false
|
242
|
+
|
243
|
+
Style/SignalException:
|
244
|
+
Description: 'Checks for proper usage of fail and raise.'
|
245
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
246
|
+
Enabled: false
|
247
|
+
|
248
|
+
Style/SpecialGlobalVars:
|
249
|
+
Description: 'Avoid Perl-style global variables.'
|
250
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
251
|
+
Enabled: false
|
252
|
+
|
253
|
+
Style/StringLiterals:
|
254
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
255
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
256
|
+
EnforcedStyle: single_quotes
|
257
|
+
Enabled: true
|
258
|
+
|
259
|
+
Style/TrailingCommaInArguments:
|
260
|
+
Description: >-
|
261
|
+
Checks for trailing comma in argument lists. Supported styles are:
|
262
|
+
comma
|
263
|
+
consistent_comma
|
264
|
+
no_comma
|
265
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
266
|
+
EnforcedStyleForMultiline: no_comma
|
267
|
+
Enabled: true
|
268
|
+
|
269
|
+
Style/TrailingCommaInArrayLiteral:
|
270
|
+
Description: >-
|
271
|
+
Checks for trailing comma in array and hash literals. Supported styles are:
|
272
|
+
comma
|
273
|
+
consistent_comma
|
274
|
+
no_comma
|
275
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
276
|
+
EnforcedStyleForMultiline: no_comma
|
277
|
+
Enabled: true
|
278
|
+
|
279
|
+
Style/TrivialAccessors:
|
280
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
281
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
282
|
+
Enabled: false
|
283
|
+
|
284
|
+
Style/VariableInterpolation:
|
285
|
+
Description: >-
|
286
|
+
Don't interpolate global, instance and class variables
|
287
|
+
directly in strings.
|
288
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
289
|
+
Enabled: false
|
290
|
+
|
291
|
+
Style/WhenThen:
|
292
|
+
Description: 'Use when x then ... for one-line cases.'
|
293
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
294
|
+
Enabled: false
|
295
|
+
|
296
|
+
Style/WhileUntilModifier:
|
297
|
+
Description: >-
|
298
|
+
Favor modifier while/until usage when you have a
|
299
|
+
single-line body.
|
300
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
301
|
+
Enabled: false
|
302
|
+
|
303
|
+
Style/WordArray:
|
304
|
+
Description: 'Use %w or %W for arrays of words.'
|
305
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
306
|
+
Enabled: false
|
307
|
+
|
308
|
+
Style/SymbolArray:
|
309
|
+
Description: This cop checks for array literals made up of symbols that are not using the %i() syntax.
|
310
|
+
Enabled: false
|
311
|
+
|
312
|
+
Style/Sample:
|
313
|
+
Description: >-
|
314
|
+
Use `sample` instead of `shuffle.first`,
|
315
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
316
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
317
|
+
Enabled: false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: niftany
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Wead
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.61'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-performance
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.1'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rubocop-rspec
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +100,28 @@ dependencies:
|
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
103
|
+
version: '2.0'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
110
|
+
version: '2.0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rake
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
117
|
+
version: '12.0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
124
|
+
version: '12.0'
|
111
125
|
description: Combining "nittany" and "nifty" into one, super-nice gem that lints all
|
112
126
|
our code at once.
|
113
127
|
email:
|
@@ -121,6 +135,7 @@ files:
|
|
121
135
|
- ".gitignore"
|
122
136
|
- ".rubocop.yml"
|
123
137
|
- ".rubocop_todo.yml"
|
138
|
+
- ".ruby-version"
|
124
139
|
- ".travis.yml"
|
125
140
|
- Gemfile
|
126
141
|
- LICENSE.md
|
@@ -136,6 +151,12 @@ files:
|
|
136
151
|
- niftany_rubocop_rspec.yml
|
137
152
|
- niftany_rubocop_ruby.yml
|
138
153
|
- niftany_scsslint.yml
|
154
|
+
- rubocop/layout.yml
|
155
|
+
- rubocop/lint.yml
|
156
|
+
- rubocop/metrics.yml
|
157
|
+
- rubocop/naming.yml
|
158
|
+
- rubocop/performance.yml
|
159
|
+
- rubocop/style.yml
|
139
160
|
homepage: https://github.com/psu-libraries/niftany
|
140
161
|
licenses: []
|
141
162
|
metadata: {}
|
@@ -154,8 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
175
|
- !ruby/object:Gem::Version
|
155
176
|
version: '0'
|
156
177
|
requirements: []
|
157
|
-
|
158
|
-
rubygems_version: 2.7.7
|
178
|
+
rubygems_version: 3.0.3
|
159
179
|
signing_key:
|
160
180
|
specification_version: 4
|
161
181
|
summary: Manages configurations and versions of linters used in projects at Penn State
|