<commit_before>module Fastlane
  module Actions
    module SharedValues
      SNAPSHOT_SCREENSHOTS_PATH = :SNAPSHOT_SCREENSHOTS_PATH
    end

    class SnapshotAction < Action
      def self.run(params)
        clean = true
        clean = false if params.include?(:noclean)
        $verbose = true if params.include?(:verbose)

        if Helper.test?
          Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = Dir.pwd
          return clean
        end

        require 'snapshot'

        Dir.chdir(FastlaneFolder.path) do
          Snapshot::SnapshotConfig.shared_instance
          Snapshot::Runner.new.work(clean: clean)

          results_path = Snapshot::SnapshotConfig.shared_instance.screenshots_path

          Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = File.expand_path(results_path) # absolute URL
        end
      end

      def self.description
        "Generate new localised screenshots on multiple devices"
      end

      def self.available_options
        [
          ['noclean', 'Skips the clean process when building the app'],
          ['verbose', 'Print out the UI Automation output']
        ]
      end
    end
  end
end
<commit_msg>Updated snapshot update check<commit_after>module Fastlane
  module Actions
    module SharedValues
      SNAPSHOT_SCREENSHOTS_PATH = :SNAPSHOT_SCREENSHOTS_PATH
    end

    class SnapshotAction < Action
      def self.run(params)
        clean = true
        clean = false if params.include?(:noclean)
        $verbose = true if params.include?(:verbose)

        if Helper.test?
          Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = Dir.pwd
          return clean
        end

        require 'snapshot'

        FastlaneCore::UpdateChecker.start_looking_for_update('snapshot')

        begin
          Dir.chdir(FastlaneFolder.path) do
            Snapshot::SnapshotConfig.shared_instance
            Snapshot::Runner.new.work(clean: clean)

            results_path = Snapshot::SnapshotConfig.shared_instance.screenshots_path

            Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] = File.expand_path(results_path) # absolute URL
          end
        ensure
          FastlaneCore::UpdateChecker.show_update_status('snapshot', Snapshot::VERSION)
        end
      end

      def self.description
        "Generate new localised screenshots on multiple devices"
      end

      def self.available_options
        [
          ['noclean', 'Skips the clean process when building the app'],
          ['verbose', 'Print out the UI Automation output']
        ]
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07042253521126761, 'fraction_numerical': 0.0, 'mean_word_length': 2.480794701986755, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5264465', 'n_tokens_mistral': 753, 'n_tokens_neox': 749, 'n_words': 165}