<commit_before># frozen_string_literal: true

module RuboCop
  module Cop
    # Helpers for builtin documentation
    module Documentation
      module_function

      # @api private
      def department_to_basename(department)
        "cops_#{department.downcase}"
      end

      # @api private
      def url_for(cop_class)
        base = department_to_basename(cop_class.department)
        fragment = cop_class.cop_name.downcase.gsub(/[^a-z]/, '')
        "https://docs.rubocop.org/rubocop/#{base}.html##{fragment}"
      end
    end
  end
end
<commit_msg>Fix sub-department cop doc generation<commit_after># frozen_string_literal: true

module RuboCop
  module Cop
    # Helpers for builtin documentation
    module Documentation
      module_function

      # @api private
      def department_to_basename(department)
        "cops_#{department.to_s.downcase.tr('/', '_')}"
      end

      # @api private
      def url_for(cop_class)
        base = department_to_basename(cop_class.department)
        fragment = cop_class.cop_name.downcase.gsub(/[^a-z]/, '')
        "https://docs.rubocop.org/rubocop/#{base}.html##{fragment}"
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.1056701030927835, 'fraction_numerical': 0.0, 'mean_word_length': 2.8322368421052633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6937870', 'n_tokens_mistral': 385, 'n_tokens_neox': 374, 'n_words': 70}