phacility/phabricator · warning · Exception

Specify one or more files to atomize.

Error message

Specify one or more files to atomize.

What it means

Diviner's atomize workflow takes the files to process as wildcard (positional) arguments. After the atomizer is constructed, execute() reads $args->getArg('files') and throws this plain Exception when the list is empty. Unlike the neighboring errors it is a generic Exception, not PhutilArgumentUsageException, so it surfaces with a stack trace rather than a usage message.

Solutions

  1. Append one or more file paths after the flags: `diviner atomize --book b.book --atomizer DivinerPHPAtomizer src/*.php`
  2. Check the glob actually matches: run `ls src/*.php` in the same directory and cwd
  3. If passing a variable in a script, fail fast when it is empty instead of running Diviner

Example fix

# before
diviner atomize --book docs/book.book --atomizer DivinerPHPAtomizer
# after
diviner atomize --book docs/book.book --atomizer DivinerPHPAtomizer src/**/*.php
Defensive patterns

Strategy: validation

Validate before calling

$files = $args->getArg('files');
if (!$files) {
  // Refuse to run atomize with an empty file list.
  $args->printHelpAndExit();
}

Prevention

When it happens

Trigger: Invoking `diviner atomize --book ... --atomizer ...` with no trailing file paths, or with a wildcard that your shell expanded to nothing (e.g. `src/*.php` in an empty directory).

Common situations: Shell glob failing to match (empty dir, wrong cwd, or quotes around the glob preventing expansion); CI jobs that pass a variable which is empty; running atomize from a directory that does not contain the sources you meant.

Understand the failure class

Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/79f1a4dc946c5eaa. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/diviner/workflow/DivinerAtomizeWorkflow.php:62

    $symbols = id(new PhutilSymbolLoader())
      ->setName($atomizer_class)
      ->setConcreteOnly(true)
      ->setAncestorClass('DivinerAtomizer')
      ->selectAndLoadSymbols();
    if (!$symbols) {
      throw new PhutilArgumentUsageException(
        pht(
          "Atomizer class '%s' must be a concrete subclass of %s.",
          $atomizer_class,
          'DivinerAtomizer'));
    }

    $atomizer = newv($atomizer_class, array());

    $files = $args->getArg('files');
    if (!$files) {
      throw new Exception(pht('Specify one or more files to atomize.'));
    }

    $file_atomizer = new DivinerFileAtomizer();

    foreach (array($atomizer, $file_atomizer) as $configure) {
      $configure->setBook($this->getConfig('name'));
    }

    $group_rules = array();
    foreach ($this->getConfig('groups', array()) as $group => $spec) {
      $include = (array)idx($spec, 'include', array());
      foreach ($include as $pattern) {
        $group_rules[$pattern] = $group;
      }
    }

    $all_atoms = array();
    $context = array(

View on GitHub (pinned to 5720a38cfe)