<commit_before>module Cask
  class Cmd
    class Style < AbstractCommand
      def self.help
        "checks Cask style using RuboCop"
      end

      option "--fix", :fix, false

      def run
        install_rubocop
        cache_env = { "XDG_CACHE_HOME" => "#{HOMEBREW_CACHE}/style" }
        hide_warnings = debug? ? [] : [ENV["HOMEBREW_RUBY_PATH"], "-W0", "-S"]
        system(cache_env, *hide_warnings, "rubocop", *rubocop_args, "--", *cask_paths)
        raise CaskError, "style check failed" unless $CHILD_STATUS.success?
      end

      def install_rubocop
        capture_stderr do
          begin<commit_msg>Run `rubocop` in temporary directory to skip reading parent config.<commit_after>module Cask
  class Cmd
    class Style < AbstractCommand
      def self.help
        "checks Cask style using RuboCop"
      end

      option "--fix", :fix, false

      def run
        install_rubocop
        cache_env = { "XDG_CACHE_HOME" => "#{HOMEBREW_CACHE}/style" }
        hide_warnings = debug? ? [] : [ENV["HOMEBREW_RUBY_PATH"], "-W0", "-S"]
        Dir.mktmpdir do |tmpdir|
          system(cache_env, *hide_warnings, "rubocop", *rubocop_args, "--", *cask_paths, chdir: tmpdir)
        end
        raise CaskError, "style check failed" unless $CHILD_STATUS.success?
      end

      def install_rubocop
        capture_stderr do
          begin
{'fraction_non_alphanumeric': 0.10751104565537556, 'fraction_numerical': 0.0014727540500736377, 'mean_word_length': 2.4846153846153847, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1537231', 'n_tokens_mistral': 448, 'n_tokens_neox': 431, 'n_words': 110}