leftovers 0.11.1 → 0.12.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 +12 -0
- data/README.md +1 -0
- data/docs/Configuration.md +7 -0
- data/exe/leftovers +3 -1
- data/leftovers.gemspec +3 -4
- data/lib/config/activesupport.yml +1 -1
- data/lib/config/rspec.yml +21 -0
- data/lib/leftovers/ast/array_node.rb +2 -2
- data/lib/leftovers/ast/block_node.rb +1 -1
- data/lib/leftovers/ast/builder.rb +19 -18
- data/lib/leftovers/ast/casgn_node.rb +2 -2
- data/lib/leftovers/ast/const_node.rb +1 -1
- data/lib/leftovers/ast/def_node.rb +1 -1
- data/lib/leftovers/ast/defs_node.rb +1 -1
- data/lib/leftovers/ast/false_node.rb +1 -1
- data/lib/leftovers/ast/hash_node.rb +2 -2
- data/lib/leftovers/ast/module_node.rb +1 -1
- data/lib/leftovers/ast/nil_node.rb +1 -1
- data/lib/leftovers/ast/node.rb +13 -1
- data/lib/leftovers/ast/numeric_node.rb +1 -1
- data/lib/leftovers/ast/send_node.rb +16 -3
- data/lib/leftovers/ast/str_node.rb +1 -1
- data/lib/leftovers/ast/sym_node.rb +1 -1
- data/lib/leftovers/ast/true_node.rb +1 -1
- data/lib/leftovers/ast/var_node.rb +1 -1
- data/lib/leftovers/ast/vasgn_node.rb +2 -2
- data/lib/leftovers/ast.rb +2 -21
- data/lib/leftovers/autoloader.rb +36 -0
- data/lib/leftovers/cli.rb +64 -45
- data/lib/leftovers/collection.rb +66 -0
- data/lib/leftovers/collector.rb +17 -27
- data/lib/leftovers/config.rb +17 -5
- data/lib/leftovers/config_loader/attribute.rb +2 -2
- data/lib/leftovers/config_loader/bool_schema.rb +21 -0
- data/lib/leftovers/config_loader/document_schema.rb +2 -2
- data/lib/leftovers/config_loader/inherit_schema_attributes.rb +1 -1
- data/lib/leftovers/config_loader/node.rb +8 -8
- data/lib/leftovers/config_loader/regexp_schema.rb +1 -1
- data/lib/leftovers/config_loader/rule_pattern_schema.rb +1 -0
- data/lib/leftovers/config_loader/schema.rb +1 -1
- data/lib/leftovers/config_loader/string_enum_schema.rb +1 -1
- data/lib/leftovers/config_loader/value_or_array_schema.rb +1 -1
- data/lib/leftovers/config_loader.rb +8 -48
- data/lib/leftovers/definition.rb +4 -4
- data/lib/leftovers/definition_collection.rb +3 -3
- data/lib/leftovers/definition_node.rb +2 -2
- data/lib/leftovers/definition_node_set.rb +1 -1
- data/lib/leftovers/definition_set.rb +4 -4
- data/lib/leftovers/definition_to_add.rb +2 -2
- data/lib/leftovers/error.rb +6 -0
- data/lib/leftovers/file.rb +4 -4
- data/lib/leftovers/file_collector/comments_processor.rb +23 -18
- data/lib/leftovers/file_collector/node_processor/error.rb +16 -0
- data/lib/leftovers/file_collector/node_processor.rb +19 -2
- data/lib/leftovers/file_collector.rb +28 -20
- data/lib/leftovers/file_list.rb +4 -6
- data/lib/leftovers/matcher_builders/and.rb +5 -5
- data/lib/leftovers/matcher_builders/document.rb +1 -3
- data/lib/leftovers/matcher_builders/name.rb +4 -7
- data/lib/leftovers/matcher_builders/node.rb +21 -35
- data/lib/leftovers/matcher_builders/node_has_argument.rb +17 -29
- data/lib/leftovers/matcher_builders/node_has_block.rb +17 -0
- data/lib/leftovers/matcher_builders/node_has_keyword_argument.rb +7 -9
- data/lib/leftovers/matcher_builders/node_has_positional_argument.rb +10 -10
- data/lib/leftovers/matcher_builders/node_has_receiver.rb +6 -8
- data/lib/leftovers/matcher_builders/node_name.rb +3 -5
- data/lib/leftovers/matcher_builders/node_pair_key.rb +4 -4
- data/lib/leftovers/matcher_builders/node_pair_value.rb +4 -4
- data/lib/leftovers/matcher_builders/node_path.rb +3 -4
- data/lib/leftovers/matcher_builders/node_privacy.rb +3 -3
- data/lib/leftovers/matcher_builders/node_type.rb +18 -13
- data/lib/leftovers/matcher_builders/node_value.rb +18 -31
- data/lib/leftovers/matcher_builders/or.rb +10 -10
- data/lib/leftovers/matcher_builders/path.rb +3 -3
- data/lib/leftovers/matcher_builders/string_pattern.rb +2 -0
- data/lib/leftovers/matcher_builders/unless.rb +1 -3
- data/lib/leftovers/matcher_builders.rb +2 -22
- data/lib/leftovers/matchers/node_has_block.rb +13 -0
- data/lib/leftovers/matchers/node_scalar_value.rb +1 -1
- data/lib/leftovers/matchers.rb +2 -27
- data/lib/leftovers/merged_config.rb +16 -17
- data/lib/leftovers/parser.rb +1 -1
- data/lib/leftovers/precompile_error.rb +31 -0
- data/lib/leftovers/precompilers/haml.rb +23 -3
- data/lib/leftovers/precompilers/json.rb +1 -1
- data/lib/leftovers/precompilers/precompiler.rb +3 -3
- data/lib/leftovers/precompilers/slim.rb +1 -1
- data/lib/leftovers/precompilers/yaml/builder.rb +62 -0
- data/lib/leftovers/precompilers/yaml.rb +3 -56
- data/lib/leftovers/precompilers.rb +11 -16
- data/lib/leftovers/processor_builders/action.rb +15 -19
- data/lib/leftovers/processor_builders/add_prefix.rb +4 -6
- data/lib/leftovers/processor_builders/add_suffix.rb +4 -6
- data/lib/leftovers/processor_builders/argument.rb +10 -15
- data/lib/leftovers/processor_builders/dynamic.rb +12 -30
- data/lib/leftovers/processor_builders/each.rb +63 -76
- data/lib/leftovers/processor_builders/each_for_definition_set.rb +15 -0
- data/lib/leftovers/processor_builders/itself.rb +2 -4
- data/lib/leftovers/processor_builders/keyword.rb +4 -4
- data/lib/leftovers/processor_builders/keyword_argument.rb +4 -4
- data/lib/leftovers/processor_builders/receiver.rb +2 -4
- data/lib/leftovers/processor_builders/transform.rb +26 -49
- data/lib/leftovers/processor_builders/transform_chain.rb +4 -7
- data/lib/leftovers/processor_builders/transform_set.rb +6 -7
- data/lib/leftovers/processor_builders/value.rb +2 -2
- data/lib/leftovers/processor_builders.rb +2 -15
- data/lib/leftovers/processors/add_definition_node.rb +2 -2
- data/lib/leftovers/processors/camelize.rb +3 -3
- data/lib/leftovers/processors/deconstantize.rb +3 -3
- data/lib/leftovers/processors/demodulize.rb +3 -3
- data/lib/leftovers/processors/each_for_definition_set.rb +2 -2
- data/lib/leftovers/processors/eval.rb +1 -1
- data/lib/leftovers/processors/parameterize.rb +3 -3
- data/lib/leftovers/processors/placeholder.rb +1 -1
- data/lib/leftovers/processors/pluralize.rb +3 -3
- data/lib/leftovers/processors/set_default_privacy.rb +1 -1
- data/lib/leftovers/processors/set_privacy.rb +1 -1
- data/lib/leftovers/processors/singularize.rb +3 -3
- data/lib/leftovers/processors/titleize.rb +3 -3
- data/lib/leftovers/processors/underscore.rb +3 -3
- data/lib/leftovers/processors.rb +2 -44
- data/lib/leftovers/rake_task.rb +2 -2
- data/lib/leftovers/reporter.rb +44 -42
- data/lib/leftovers/runner.rb +40 -0
- data/lib/leftovers/todo_reporter.rb +96 -94
- data/lib/leftovers/unexpected_case.rb +8 -0
- data/lib/leftovers/version.rb +1 -1
- data/lib/leftovers.rb +23 -108
- metadata +15 -18
- data/lib/leftovers/matcher_builders/and_not.rb +0 -16
@@ -3,100 +3,102 @@
|
|
3
3
|
require 'pathname'
|
4
4
|
|
5
5
|
module Leftovers
|
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
|
-
|
6
|
+
module TodoReporter
|
7
|
+
class << self
|
8
|
+
def prepare
|
9
|
+
return unless path.exist?
|
10
|
+
|
11
|
+
puts "Removing previous #{path.basename} file"
|
12
|
+
puts ''
|
13
|
+
path.delete
|
14
|
+
end
|
15
|
+
|
16
|
+
def report(collection)
|
17
|
+
path.write(generate_file_body(collection))
|
18
|
+
report_instructions
|
19
|
+
|
20
|
+
0
|
21
|
+
end
|
22
|
+
|
23
|
+
def report_success
|
24
|
+
puts "No #{path.basename} file generated, everything is used"
|
25
|
+
|
26
|
+
0
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def report_instructions
|
32
|
+
puts <<~MESSAGE
|
33
|
+
generated #{path.basename}.
|
34
|
+
running leftovers again will read this file and not alert you to any unused items mentioned in it.
|
35
|
+
|
36
|
+
commit this file so you/your team can gradually address these items while still having leftovers alert you to any newly unused items.
|
37
|
+
MESSAGE
|
38
|
+
end
|
39
|
+
|
40
|
+
def path
|
41
|
+
::Leftovers.pwd.join('.leftovers_todo.yml')
|
42
|
+
end
|
43
|
+
|
44
|
+
def generate_file_body(collection)
|
45
|
+
<<~YML.chomp
|
46
|
+
#{generation_message.chomp}
|
47
|
+
#
|
48
|
+
#{resolution_instructions}
|
49
|
+
#{todo_data(collection).chomp}
|
50
|
+
YML
|
51
|
+
end
|
52
|
+
|
53
|
+
def generation_message
|
54
|
+
<<~YML
|
55
|
+
# This file was generated by `leftovers --write-todo`
|
56
|
+
# Generated at: #{Time.now.utc.strftime('%F %T')} UTC
|
57
|
+
YML
|
58
|
+
end
|
59
|
+
|
60
|
+
def resolution_instructions
|
61
|
+
<<~YML
|
62
|
+
# for instructions on how to address these
|
63
|
+
# see #{::Leftovers.resolution_instructions_link}
|
64
|
+
YML
|
65
|
+
end
|
66
|
+
|
67
|
+
def todo_data(collection)
|
68
|
+
[
|
69
|
+
list_data(
|
70
|
+
:test_only, 'Only directly called in tests', collection.with_tests
|
71
|
+
),
|
72
|
+
list_data(
|
73
|
+
:keep, 'Not directly called at all', collection.without_tests
|
74
|
+
)
|
75
|
+
].compact.join
|
76
|
+
end
|
77
|
+
|
78
|
+
def list_data(key, title, list)
|
79
|
+
return if list.empty?
|
80
|
+
|
81
|
+
<<~YML
|
82
|
+
#{key}:
|
83
|
+
# #{title}:
|
84
|
+
#{print_definition_list(list)}
|
85
|
+
|
86
|
+
YML
|
87
|
+
end
|
88
|
+
|
89
|
+
def print_definition_list(definition_list)
|
90
|
+
definition_list.map { |definition| print_definition(definition) }.sort.join("\n")
|
91
|
+
end
|
92
|
+
|
93
|
+
def print_definition(definition)
|
94
|
+
return print_definition_list(definition.definitions) if definition.is_a?(DefinitionSet)
|
95
|
+
|
96
|
+
" - #{definition.to_s.inspect} # #{definition.location_s} #{definition.source_line.strip}"
|
97
|
+
end
|
98
|
+
|
99
|
+
def puts(string)
|
100
|
+
::Leftovers.puts(string)
|
101
|
+
end
|
100
102
|
end
|
101
103
|
end
|
102
104
|
end
|
data/lib/leftovers/version.rb
CHANGED
data/lib/leftovers.rb
CHANGED
@@ -1,118 +1,38 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module Leftovers
|
4
|
+
class Exit < ::StandardError
|
5
|
+
attr_reader :status
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
class UnexpectedCase < Error; end
|
9
|
-
|
10
|
-
class PrecompileError < Error
|
11
|
-
attr_reader :line, :column
|
12
|
-
|
13
|
-
def initialize(message, line: nil, column: nil)
|
14
|
-
@line = line
|
15
|
-
@column = column
|
16
|
-
super(message)
|
17
|
-
end
|
18
|
-
|
19
|
-
def warn(path:)
|
20
|
-
line_column = ":#{line}#{":#{column}" if column}" if line
|
21
|
-
klass = cause ? cause.class : self.class
|
22
|
-
|
23
|
-
Leftovers.warn "#{klass}: #{path}#{line_column} #{message}"
|
7
|
+
def initialize(status) # rubocop:disable Lint/MissingSuper
|
8
|
+
@status = status
|
24
9
|
end
|
25
10
|
end
|
26
11
|
|
27
|
-
|
28
|
-
|
29
|
-
autoload(:Collector, "#{__dir__}/leftovers/collector")
|
30
|
-
autoload(:ComparableInstance, "#{__dir__}/leftovers/comparable_instance")
|
31
|
-
autoload(:ConfigLoader, "#{__dir__}/leftovers/config_loader")
|
32
|
-
autoload(:Config, "#{__dir__}/leftovers/config")
|
33
|
-
autoload(:Definition, "#{__dir__}/leftovers/definition")
|
34
|
-
autoload(:DefinitionCollection, "#{__dir__}/leftovers/definition_collection")
|
35
|
-
autoload(:DefinitionNode, "#{__dir__}/leftovers/definition_node")
|
36
|
-
autoload(:DefinitionNodeSet, "#{__dir__}/leftovers/definition_node_set")
|
37
|
-
autoload(:DefinitionSet, "#{__dir__}/leftovers/definition_set")
|
38
|
-
autoload(:DefinitionToAdd, "#{__dir__}/leftovers/definition_to_add")
|
39
|
-
autoload(:FileCollector, "#{__dir__}/leftovers/file_collector")
|
40
|
-
autoload(:FileList, "#{__dir__}/leftovers/file_list")
|
41
|
-
autoload(:File, "#{__dir__}/leftovers/file")
|
42
|
-
autoload(:MatcherBuilders, "#{__dir__}/leftovers/matcher_builders")
|
43
|
-
autoload(:Matchers, "#{__dir__}/leftovers/matchers")
|
44
|
-
autoload(:MergedConfig, "#{__dir__}/leftovers/merged_config")
|
45
|
-
autoload(:Parser, "#{__dir__}/leftovers/parser")
|
46
|
-
autoload(:Precompilers, "#{__dir__}/leftovers/precompilers")
|
47
|
-
autoload(:ProcessorBuilders, "#{__dir__}/leftovers/processor_builders")
|
48
|
-
autoload(:RakeTask, "#{__dir__}/leftovers/rake_task")
|
49
|
-
autoload(:Reporter, "#{__dir__}/leftovers/reporter")
|
50
|
-
autoload(:TodoReporter, "#{__dir__}/leftovers/todo_reporter")
|
51
|
-
autoload(:Processors, "#{__dir__}/leftovers/processors")
|
52
|
-
autoload(:VERSION, "#{__dir__}/leftovers/version")
|
12
|
+
require_relative 'leftovers/autoloader'
|
13
|
+
include Autoloader
|
53
14
|
|
54
15
|
MEMOIZED_IVARS = %i{
|
55
16
|
@config
|
56
|
-
@collector
|
57
|
-
@reporter
|
58
|
-
@leftovers
|
59
17
|
@try_require_cache
|
60
18
|
@stdout
|
61
19
|
@stderr
|
62
|
-
@parallel
|
63
20
|
@pwd
|
64
|
-
@progress
|
65
21
|
}.freeze
|
66
22
|
|
67
23
|
class << self
|
68
|
-
|
69
|
-
attr_writer :reporter
|
70
|
-
alias_method :parallel?, :parallel
|
71
|
-
alias_method :progress?, :progress
|
24
|
+
attr_writer :stdout, :stderr
|
72
25
|
|
73
26
|
def stdout
|
74
|
-
@stdout ||=
|
27
|
+
@stdout ||= ::StringIO.new
|
75
28
|
end
|
76
29
|
|
77
30
|
def stderr
|
78
|
-
@stderr ||=
|
31
|
+
@stderr ||= ::StringIO.new
|
79
32
|
end
|
80
33
|
|
81
34
|
def config
|
82
|
-
@config ||=
|
83
|
-
end
|
84
|
-
|
85
|
-
def collector
|
86
|
-
@collector ||= Leftovers::Collector.new
|
87
|
-
end
|
88
|
-
|
89
|
-
def reporter
|
90
|
-
@reporter ||= Leftovers::Reporter.new
|
91
|
-
end
|
92
|
-
|
93
|
-
def leftovers
|
94
|
-
@leftovers ||= begin
|
95
|
-
collector.collect
|
96
|
-
collector.definitions.reject(&:in_collection?)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def run(stdout: StringIO.new, stderr: StringIO.new) # rubocop:disable Metrics/MethodLength
|
101
|
-
@stdout = stdout
|
102
|
-
@stderr = stderr
|
103
|
-
return reporter.report_success if leftovers.empty?
|
104
|
-
|
105
|
-
only_test = []
|
106
|
-
none = []
|
107
|
-
leftovers.sort_by(&:location_s).each do |definition|
|
108
|
-
if !definition.test? && definition.in_test_collection?
|
109
|
-
only_test << definition
|
110
|
-
else
|
111
|
-
none << definition
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
reporter.report(only_test: only_test, none: none)
|
35
|
+
@config ||= MergedConfig.new(load_defaults: true)
|
116
36
|
end
|
117
37
|
|
118
38
|
def reset
|
@@ -122,16 +42,17 @@ module Leftovers # rubocop:disable Metrics/ModuleLength
|
|
122
42
|
end
|
123
43
|
|
124
44
|
def resolution_instructions_link
|
125
|
-
"https://github.com/robotdana/leftovers/tree/v#{
|
45
|
+
"https://github.com/robotdana/leftovers/tree/v#{VERSION}/README.md#how-to-resolve"
|
126
46
|
end
|
127
47
|
|
128
48
|
def warn(message)
|
129
49
|
stderr.puts("\e[2K#{message}")
|
130
50
|
end
|
131
51
|
|
132
|
-
def error(message)
|
52
|
+
def error(message, did_you_mean = nil)
|
133
53
|
warn("\e[31m#{message}\e[0m")
|
134
|
-
|
54
|
+
warn("\n#{did_you_mean}") if did_you_mean
|
55
|
+
raise Exit, 1
|
135
56
|
end
|
136
57
|
|
137
58
|
def puts(message)
|
@@ -139,19 +60,15 @@ module Leftovers # rubocop:disable Metrics/ModuleLength
|
|
139
60
|
end
|
140
61
|
|
141
62
|
def print(message)
|
142
|
-
stdout.print(message)
|
143
|
-
end
|
144
|
-
|
145
|
-
def newline
|
146
|
-
stdout.puts('')
|
63
|
+
stdout.print("\e[2K#{message}\r")
|
147
64
|
end
|
148
65
|
|
149
66
|
def pwd
|
150
|
-
@pwd ||= Pathname.new(Dir.pwd + '/')
|
67
|
+
@pwd ||= ::Pathname.new(::Dir.pwd + '/')
|
151
68
|
end
|
152
69
|
|
153
70
|
def exit(status = 0)
|
154
|
-
|
71
|
+
raise Exit, status
|
155
72
|
end
|
156
73
|
|
157
74
|
def try_require(requirable, message: nil)
|
@@ -159,13 +76,11 @@ module Leftovers # rubocop:disable Metrics/ModuleLength
|
|
159
76
|
try_require_cache(requirable)
|
160
77
|
end
|
161
78
|
|
162
|
-
def
|
163
|
-
return enum_for(__method__, value) unless block
|
164
|
-
|
79
|
+
def wrap_array(value)
|
165
80
|
case value
|
166
|
-
when nil then
|
167
|
-
when Array then value
|
168
|
-
else
|
81
|
+
when nil then []
|
82
|
+
when ::Array then value
|
83
|
+
else [value]
|
169
84
|
end
|
170
85
|
end
|
171
86
|
|
@@ -185,7 +100,7 @@ module Leftovers # rubocop:disable Metrics/ModuleLength
|
|
185
100
|
@try_require_cache.fetch(requirable) do
|
186
101
|
require requirable
|
187
102
|
@try_require_cache[requirable] = true
|
188
|
-
rescue LoadError
|
103
|
+
rescue ::LoadError
|
189
104
|
@try_require_cache[requirable] = false
|
190
105
|
end
|
191
106
|
end
|
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.12.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:
|
11
|
+
date: 2023-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: did_you_mean
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: haml
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -396,7 +382,9 @@ files:
|
|
396
382
|
- lib/leftovers/ast/true_node.rb
|
397
383
|
- lib/leftovers/ast/var_node.rb
|
398
384
|
- lib/leftovers/ast/vasgn_node.rb
|
385
|
+
- lib/leftovers/autoloader.rb
|
399
386
|
- lib/leftovers/cli.rb
|
387
|
+
- lib/leftovers/collection.rb
|
400
388
|
- lib/leftovers/collector.rb
|
401
389
|
- lib/leftovers/comparable_instance.rb
|
402
390
|
- lib/leftovers/config.rb
|
@@ -405,6 +393,7 @@ files:
|
|
405
393
|
- lib/leftovers/config_loader/argumentless_transform_schema.rb
|
406
394
|
- lib/leftovers/config_loader/array_schema.rb
|
407
395
|
- lib/leftovers/config_loader/attribute.rb
|
396
|
+
- lib/leftovers/config_loader/bool_schema.rb
|
408
397
|
- lib/leftovers/config_loader/built_in_precompiler_schema.rb
|
409
398
|
- lib/leftovers/config_loader/document_schema.rb
|
410
399
|
- lib/leftovers/config_loader/dynamic_schema.rb
|
@@ -445,18 +434,20 @@ files:
|
|
445
434
|
- lib/leftovers/definition_node_set.rb
|
446
435
|
- lib/leftovers/definition_set.rb
|
447
436
|
- lib/leftovers/definition_to_add.rb
|
437
|
+
- lib/leftovers/error.rb
|
448
438
|
- lib/leftovers/file.rb
|
449
439
|
- lib/leftovers/file_collector.rb
|
450
440
|
- lib/leftovers/file_collector/comments_processor.rb
|
451
441
|
- lib/leftovers/file_collector/node_processor.rb
|
442
|
+
- lib/leftovers/file_collector/node_processor/error.rb
|
452
443
|
- lib/leftovers/file_list.rb
|
453
444
|
- lib/leftovers/matcher_builders.rb
|
454
445
|
- lib/leftovers/matcher_builders/and.rb
|
455
|
-
- lib/leftovers/matcher_builders/and_not.rb
|
456
446
|
- lib/leftovers/matcher_builders/document.rb
|
457
447
|
- lib/leftovers/matcher_builders/name.rb
|
458
448
|
- lib/leftovers/matcher_builders/node.rb
|
459
449
|
- lib/leftovers/matcher_builders/node_has_argument.rb
|
450
|
+
- lib/leftovers/matcher_builders/node_has_block.rb
|
460
451
|
- lib/leftovers/matcher_builders/node_has_keyword_argument.rb
|
461
452
|
- lib/leftovers/matcher_builders/node_has_positional_argument.rb
|
462
453
|
- lib/leftovers/matcher_builders/node_has_receiver.rb
|
@@ -479,6 +470,7 @@ files:
|
|
479
470
|
- lib/leftovers/matchers/node_has_any_keyword_argument.rb
|
480
471
|
- lib/leftovers/matchers/node_has_any_positional_argument_with_value.rb
|
481
472
|
- lib/leftovers/matchers/node_has_any_receiver.rb
|
473
|
+
- lib/leftovers/matchers/node_has_block.rb
|
482
474
|
- lib/leftovers/matchers/node_has_positional_argument.rb
|
483
475
|
- lib/leftovers/matchers/node_has_positional_argument_with_value.rb
|
484
476
|
- lib/leftovers/matchers/node_has_receiver.rb
|
@@ -495,6 +487,7 @@ files:
|
|
495
487
|
- lib/leftovers/matchers/path.rb
|
496
488
|
- lib/leftovers/merged_config.rb
|
497
489
|
- lib/leftovers/parser.rb
|
490
|
+
- lib/leftovers/precompile_error.rb
|
498
491
|
- lib/leftovers/precompilers.rb
|
499
492
|
- lib/leftovers/precompilers/erb.rb
|
500
493
|
- lib/leftovers/precompilers/haml.rb
|
@@ -502,6 +495,7 @@ files:
|
|
502
495
|
- lib/leftovers/precompilers/precompiler.rb
|
503
496
|
- lib/leftovers/precompilers/slim.rb
|
504
497
|
- lib/leftovers/precompilers/yaml.rb
|
498
|
+
- lib/leftovers/precompilers/yaml/builder.rb
|
505
499
|
- lib/leftovers/processor_builders.rb
|
506
500
|
- lib/leftovers/processor_builders/action.rb
|
507
501
|
- lib/leftovers/processor_builders/add_prefix.rb
|
@@ -509,6 +503,7 @@ files:
|
|
509
503
|
- lib/leftovers/processor_builders/argument.rb
|
510
504
|
- lib/leftovers/processor_builders/dynamic.rb
|
511
505
|
- lib/leftovers/processor_builders/each.rb
|
506
|
+
- lib/leftovers/processor_builders/each_for_definition_set.rb
|
512
507
|
- lib/leftovers/processor_builders/itself.rb
|
513
508
|
- lib/leftovers/processor_builders/keyword.rb
|
514
509
|
- lib/leftovers/processor_builders/keyword_argument.rb
|
@@ -563,7 +558,9 @@ files:
|
|
563
558
|
- lib/leftovers/processors/upcase.rb
|
564
559
|
- lib/leftovers/rake_task.rb
|
565
560
|
- lib/leftovers/reporter.rb
|
561
|
+
- lib/leftovers/runner.rb
|
566
562
|
- lib/leftovers/todo_reporter.rb
|
563
|
+
- lib/leftovers/unexpected_case.rb
|
567
564
|
- lib/leftovers/version.rb
|
568
565
|
homepage: http://github.com/robotdana/leftovers
|
569
566
|
licenses:
|
@@ -588,7 +585,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
588
585
|
- !ruby/object:Gem::Version
|
589
586
|
version: '0'
|
590
587
|
requirements: []
|
591
|
-
rubygems_version: 3.
|
588
|
+
rubygems_version: 3.4.1
|
592
589
|
signing_key:
|
593
590
|
specification_version: 4
|
594
591
|
summary: Find unused methods and classes/modules
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen-string-literal: true
|
2
|
-
|
3
|
-
module Leftovers
|
4
|
-
module MatcherBuilders
|
5
|
-
module AndNot
|
6
|
-
class << self
|
7
|
-
def build(positive_matcher, negative_matcher)
|
8
|
-
::Leftovers::MatcherBuilders::And.build([
|
9
|
-
positive_matcher,
|
10
|
-
::Leftovers::MatcherBuilders::Unless.build(negative_matcher)
|
11
|
-
])
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|