<commit_before>defmodule Mix.Tasks.Phoenix.Digest.Clean do
  use Mix.Task
  @default_output_path "priv/static"
  @default_age 3600
  @default_keep 2

  @shortdoc "Removes old versions of static assets."
  @recursive true

  @moduledoc """
  Removes old versions of compiled assets.

  By default, it will keep the latest version and
  2 previous versions as well as any digest created
  in the last hour.

      mix phoenix.digest.clean
      mix phoenix.digest.clean -o /www/public
      mix phoenix.digest.clean --age 600 --keep 3

  ## Options

    * `-o, --output` - indicates the path to your compiled
      assets directory. Defaults to `priv/static`.

    * `--age` - specifies a maximum age (in minutes) for assets.
      Files older than age that are not in the last `--keep` versions
      will be removed. Defaults to 3600 (1 hour).

    * `--keep` - specifies how many previous versions of assets to keep.
      Defaults to 2 previous version.

  """
  def run(args) do
    switches = [output: :string, age: :integer, keep: :integer]
    {opts, _, _} = OptionParser.parse(args, switches: switches, aliases: [o: :output])
    output_path = opts[:output] || @default_output_path
    age = opts[:age] || @default_age
    keep = opts[:keep] || @default_keep

    {:ok, _} = Application.ensure_all_started(:phoenix)
<commit_msg>Fix mix digest.clean docs (seconds vs minutes) (#2049)<commit_after>defmodule Mix.Tasks.Phoenix.Digest.Clean do
  use Mix.Task
  @default_output_path "priv/static"
  @default_age 3600
  @default_keep 2

  @shortdoc "Removes old versions of static assets."
  @recursive true

  @moduledoc """
  Removes old versions of compiled assets.

  By default, it will keep the latest version and
  2 previous versions as well as any digest created
  in the last hour.

      mix phoenix.digest.clean
      mix phoenix.digest.clean -o /www/public
      mix phoenix.digest.clean --age 600 --keep 3

  ## Options

    * `-o, --output` - indicates the path to your compiled
      assets directory. Defaults to `priv/static`.

    * `--age` - specifies a maximum age (in seconds) for assets.
      Files older than age that are not in the last `--keep` versions
      will be removed. Defaults to 3600 (1 hour).

    * `--keep` - specifies how many previous versions of assets to keep.
      Defaults to 2 previous version.

  """
  def run(args) do
    switches = [output: :string, age: :integer, keep: :integer]
    {opts, _, _} = OptionParser.parse(args, switches: switches, aliases: [o: :output])
    output_path = opts[:output] || @default_output_path
    age = opts[:age] || @default_age
    keep = opts[:keep] || @default_keep

    {:ok, _} = Application.ensure_all_started(:phoenix)

{'fraction_non_alphanumeric': 0.10623386204352638, 'fraction_numerical': 0.013279232755440797, 'mean_word_length': 3.0781954887218044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6703462', 'n_tokens_mistral': 885, 'n_tokens_neox': 819, 'n_words': 301}