Pass all the files to msftidy to speed things up

This commit is contained in:
Spencer McIntyre
2025-10-07 13:56:50 -04:00
parent 05c854b1c5
commit d727302de6
2 changed files with 14 additions and 8 deletions
+6
View File
@@ -923,6 +923,8 @@ class Msftidy
rubocop_result = rubocop_runner.run(full_filepath, options)
@exit_status = MsftidyRunner::ERROR if rubocop_result != RuboCop::CLI::STATUS_SUCCESS
return @exit_status if options[:fail_fast] && @exit_status != 0
end
rescue Errno::ENOENT
$stderr.puts "#{File.basename(__FILE__)}: #{dir}: No such file or directory"
@@ -955,6 +957,10 @@ if __FILE__ == $PROGRAM_NAME
opts.on('-A', '--auto-correct-all', 'Auto-correct offenses (safe and unsafe).') do |auto_correct_all|
options[:auto_correct_all] = auto_correct_all
end
opts.on('--fail-fast', 'Exit after the first detected failure instead of processing the rest of the files.') do |fail_fast|
options[:fail_fast] = fail_fast
end
end
options_parser.parse!
+8 -8
View File
@@ -74,15 +74,15 @@ if files_to_check.empty?
puts "--- No Metasploit modules to check ---"
else
puts "--- Checking new and changed module syntax with tools/dev/msftidy.rb ---"
files_to_check.each do |fname|
command = "bundle exec ruby ./tools/dev/msftidy.rb #{fname}"
msftidy_output, status = ::Open3.capture2(command)
valid = false unless status.success?
puts "#{fname} - msftidy check passed" if msftidy_output.empty?
msftidy_output.each_line do |line|
puts line
end
command = %w[bundle exec ruby ./tools/dev/msftidy.rb] + files_to_check
msftidy_output, status = ::Open3.capture2(*command)
valid = false unless status.success?
puts "#{fname} - msftidy check passed" if msftidy_output.empty?
msftidy_output.each_line do |line|
puts line
end
puts "-" * 72
end