Created
December 19, 2024 08:06
-
-
Save byroot/87235e9c2553aacd36c31b1f16e81b84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src_count = frozen_src_count = 0 | |
ARGV.each do |gem_path| | |
Dir.glob(File.join(gem_path, "**/*.rb")) do |file| | |
next unless File.file?(file) && File.readable?(file) | |
src_count += 1 | |
frozen_src_count += 1 if File.binread(file) =~ /^# frozen[-_]string[-_]literal: (true|false)$/ | |
end | |
end | |
puts "total files: #{src_count}" | |
puts "files with comment: #{frozen_src_count}" | |
puts "rate #{((frozen_src_count.to_f / src_count) * 100).round(1)}%" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment