<commit_before>require_relative '../lib/reek/smells/smell_repository'
require 'yaml'

namespace :configuration do
  task :update_default_configuration do
    DEFAULT_SMELL_CONFIGURATION = 'config/defaults.reek'
    content = Reek::Smells::SmellRepository.smell_types.each_with_object({}) do |klass, hash|
      hash[klass.smell_type] = klass.default_config
    end
    File.open(DEFAULT_SMELL_CONFIGURATION, 'w') { |file| YAML.dump(content, file) }<commit_msg>Add missing description to Rake task.<commit_after>require_relative '../lib/reek/smells/smell_repository'
require 'yaml'

namespace :configuration do
  desc 'Updates the default configuration file when smell defaults change'
  task :update_default_configuration do
    DEFAULT_SMELL_CONFIGURATION = 'config/defaults.reek'
    content = Reek::Smells::SmellRepository.smell_types.each_with_object({}) do |klass, hash|
      hash[klass.smell_type] = klass.default_config
    end
    File.open(DEFAULT_SMELL_CONFIGURATION, 'w') { |file| YAML.dump(content, file) }
{'fraction_non_alphanumeric': 0.1069676153091266, 'fraction_numerical': 0.0, 'mean_word_length': 5.580645161290323, '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': '1845491', 'n_tokens_mistral': 322, 'n_tokens_neox': 325, 'n_words': 65}