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
|
# File 'lib/packwerk/commands/check_command.rb', line 13
def run
if @files_for_processing.files.empty?
out.puts(" No files found or given.\n Specify files or check the include and exclude glob in the config file.\n MSG\n\n true\n end\n\n all_offenses = T.let([], T::Array[Offense])\n on_interrupt = T.let(-> { progress_formatter.interrupted }, T.proc.void)\n\n progress_formatter.started_inspection(@files_for_processing.files) do\n all_offenses = parse_run.find_offenses(run_context, on_interrupt: on_interrupt) do |offenses|\n failed = offenses.any? { |offense| !offense_collection.listed?(offense) }\n progress_formatter.increment_progress(failed)\n end\n end\n offense_collection.add_offenses(all_offenses)\n\n unlisted_strict_mode_violations = offense_collection.unlisted_strict_mode_violations\n\n messages = [\n offenses_formatter.show_offenses(offense_collection.outstanding_offenses),\n offenses_formatter.show_stale_violations(offense_collection, @files_for_processing.files),\n offenses_formatter.show_strict_mode_violations(unlisted_strict_mode_violations),\n ]\n\n out.puts(messages.select(&:present?).join(\"\\n\") + \"\\n\")\n\n offense_collection.outstanding_offenses.empty? &&\n !offense_collection.stale_violations?(@files_for_processing.files) &&\n unlisted_strict_mode_violations.empty?\nend\n".squish)
|