leftovers 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/docs/Configuration.md +46 -11
- data/lib/config/actioncable.yml +4 -0
- data/lib/config/actionmailer.yml +22 -0
- data/lib/config/actionpack.yml +190 -0
- data/lib/config/actionview.yml +64 -0
- data/lib/config/activejob.yml +29 -0
- data/lib/config/activemodel.yml +74 -0
- data/lib/config/activerecord.yml +179 -0
- data/lib/config/activesupport.yml +98 -0
- data/lib/config/haml.yml +2 -0
- data/lib/config/rails.yml +11 -450
- data/lib/config/ruby.yml +6 -0
- data/lib/leftovers/ast/node.rb +14 -0
- data/lib/leftovers/config.rb +8 -0
- data/lib/leftovers/config_validator/schema_hash.rb +50 -5
- data/lib/leftovers/file.rb +2 -3
- data/lib/leftovers/matcher_builders/node.rb +2 -0
- data/lib/leftovers/matcher_builders/node_has_argument.rb +11 -7
- data/lib/leftovers/matcher_builders/node_has_keyword_argument.rb +14 -10
- data/lib/leftovers/matcher_builders/node_has_positional_argument.rb +17 -13
- data/lib/leftovers/matcher_builders/node_has_receiver.rb +15 -0
- data/lib/leftovers/matcher_builders/node_type.rb +7 -6
- data/lib/leftovers/matcher_builders/node_value.rb +42 -0
- data/lib/leftovers/matcher_builders.rb +3 -2
- data/lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb +4 -1
- data/lib/leftovers/matchers/node_has_positional_argument.rb +0 -4
- data/lib/leftovers/matchers/node_has_receiver.rb +20 -0
- data/lib/leftovers/matchers/predicate.rb +19 -0
- data/lib/leftovers/matchers.rb +2 -0
- data/lib/leftovers/merged_config.rb +19 -1
- data/lib/leftovers/todo_reporter.rb +9 -6
- data/lib/leftovers/version.rb +1 -1
- data/lib/leftovers.rb +95 -92
- metadata +14 -3
- data/lib/leftovers/matcher_builders/argument_node_value.rb +0 -21
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leftovers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dana Sherson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -291,6 +291,14 @@ files:
|
|
291
291
|
- docs/Configuration.md
|
292
292
|
- exe/leftovers
|
293
293
|
- leftovers.gemspec
|
294
|
+
- lib/config/actioncable.yml
|
295
|
+
- lib/config/actionmailer.yml
|
296
|
+
- lib/config/actionpack.yml
|
297
|
+
- lib/config/actionview.yml
|
298
|
+
- lib/config/activejob.yml
|
299
|
+
- lib/config/activemodel.yml
|
300
|
+
- lib/config/activerecord.yml
|
301
|
+
- lib/config/activesupport.yml
|
294
302
|
- lib/config/attr_encrypted.yml
|
295
303
|
- lib/config/audited.yml
|
296
304
|
- lib/config/builder.yml
|
@@ -343,17 +351,18 @@ files:
|
|
343
351
|
- lib/leftovers/matcher_builders.rb
|
344
352
|
- lib/leftovers/matcher_builders/and.rb
|
345
353
|
- lib/leftovers/matcher_builders/and_not.rb
|
346
|
-
- lib/leftovers/matcher_builders/argument_node_value.rb
|
347
354
|
- lib/leftovers/matcher_builders/name.rb
|
348
355
|
- lib/leftovers/matcher_builders/node.rb
|
349
356
|
- lib/leftovers/matcher_builders/node_has_argument.rb
|
350
357
|
- lib/leftovers/matcher_builders/node_has_keyword_argument.rb
|
351
358
|
- lib/leftovers/matcher_builders/node_has_positional_argument.rb
|
359
|
+
- lib/leftovers/matcher_builders/node_has_receiver.rb
|
352
360
|
- lib/leftovers/matcher_builders/node_name.rb
|
353
361
|
- lib/leftovers/matcher_builders/node_pair_name.rb
|
354
362
|
- lib/leftovers/matcher_builders/node_pair_value.rb
|
355
363
|
- lib/leftovers/matcher_builders/node_path.rb
|
356
364
|
- lib/leftovers/matcher_builders/node_type.rb
|
365
|
+
- lib/leftovers/matcher_builders/node_value.rb
|
357
366
|
- lib/leftovers/matcher_builders/or.rb
|
358
367
|
- lib/leftovers/matcher_builders/path.rb
|
359
368
|
- lib/leftovers/matcher_builders/string.rb
|
@@ -367,6 +376,7 @@ files:
|
|
367
376
|
- lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb
|
368
377
|
- lib/leftovers/matchers/node_has_positional_argument.rb
|
369
378
|
- lib/leftovers/matchers/node_has_positional_argument_with_value.rb
|
379
|
+
- lib/leftovers/matchers/node_has_receiver.rb
|
370
380
|
- lib/leftovers/matchers/node_name.rb
|
371
381
|
- lib/leftovers/matchers/node_pair_value.rb
|
372
382
|
- lib/leftovers/matchers/node_path.rb
|
@@ -374,6 +384,7 @@ files:
|
|
374
384
|
- lib/leftovers/matchers/node_type.rb
|
375
385
|
- lib/leftovers/matchers/not.rb
|
376
386
|
- lib/leftovers/matchers/or.rb
|
387
|
+
- lib/leftovers/matchers/predicate.rb
|
377
388
|
- lib/leftovers/merged_config.rb
|
378
389
|
- lib/leftovers/parser.rb
|
379
390
|
- lib/leftovers/processor_builders.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen-string-literal: true
|
2
|
-
|
3
|
-
module Leftovers
|
4
|
-
module MatcherBuilders
|
5
|
-
module ArgumentNodeValue
|
6
|
-
def self.build(pattern)
|
7
|
-
::Leftovers::MatcherBuilders::Or.each_or_self(pattern) do |pat|
|
8
|
-
case pat
|
9
|
-
when ::Integer, true, false, nil
|
10
|
-
::Leftovers::Matchers::NodeScalarValue.new(pat)
|
11
|
-
when ::String, ::Hash
|
12
|
-
::Leftovers::MatcherBuilders::NodeName.build(pat)
|
13
|
-
# :nocov:
|
14
|
-
else raise
|
15
|
-
# :nocov:
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|