<commit_before>desc 'Analyses the Ruby standard library

This task parses and analyses all the files in the Ruby standard library.
Errors that might occur during this process are catched using pry-rescue.'

task :stdlib do
  require File.expand_path('../../lib/ruby-lint', __FILE__)
  require 'pry/rescue'

  dir     = RbConfig::CONFIG['rubylibdir']
  files   = Dir.glob(File.join(dir, '/**/*.rb'))
  amount  = files.length
  spacing = "#{amount}/#{amount}:".length

  puts "Analysing the Ruby standard library"

  files.each_with_index do |file, index|
    prefix = "#{index + 1}/#{amount}:"
    path   = file.gsub(dir, '').gsub(%r{^/|/$}, '')<commit_msg>Shorter description for the stdlib task.<commit_after>desc 'Analyses the Ruby standard library'
task :stdlib do
  require File.expand_path('../../lib/ruby-lint', __FILE__)
  require 'pry/rescue'

  dir     = RbConfig::CONFIG['rubylibdir']
  files   = Dir.glob(File.join(dir, '/**/*.rb'))
  amount  = files.length
  spacing = "#{amount}/#{amount}:".length

  puts "Analysing the Ruby standard library"

  files.each_with_index do |file, index|
    prefix = "#{index + 1}/#{amount}:"
    path   = file.gsub(dir, '').gsub(%r{^/|/$}, '')
{'fraction_non_alphanumeric': 0.16989066442388562, 'fraction_numerical': 0.001682085786375105, 'mean_word_length': 3.7983870967741935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3778768', 'n_tokens_mistral': 411, 'n_tokens_neox': 397, 'n_words': 107}