[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/scripts/repository/ -> save_lint.php (source)

   1  #!/usr/bin/env php
   2  <?php
   3  
   4  require_once dirname(__FILE__).'/../__init_script__.php';
   5  
   6  $synopsis = <<<EOT
   7  **save_lint.php**
   8      Discover lint problems and save them to database so that they can
   9      be displayed in Diffusion.
  10  
  11  EOT;
  12  
  13  $args = id(new PhutilArgumentParser($argv))
  14    ->setTagline('save lint errors to database')
  15    ->setSynopsis($synopsis)
  16    ->parseStandardArguments()
  17    ->parse(array(
  18      array(
  19        'name' => 'all',
  20        'help' =>
  21          'Discover problems in the whole repository instead of just changes '.
  22          'since the last run.',
  23      ),
  24      array(
  25        'name' => 'arc',
  26        'param' => 'path',
  27        'default' => 'arc',
  28        'help' => 'Path to Arcanist executable.',
  29      ),
  30      array(
  31        'name' => 'severity',
  32        'param' => 'string',
  33        'default' => ArcanistLintSeverity::SEVERITY_ADVICE,
  34        'help' => 'Minimum severity, one of ArcanistLintSeverity constants.',
  35      ),
  36      array(
  37        'name' => 'chunk-size',
  38        'param' => 'number',
  39        'default' => 256,
  40        'help' => 'Number of paths passed to `arc` at once.',
  41      ),
  42      array(
  43        'name' => 'blame',
  44        'help' => 'Assign lint errors to authors who last modified the line.',
  45      ),
  46    ));
  47  
  48  echo "Saving lint errors to database...\n";
  49  
  50  $count = id(new DiffusionLintSaveRunner())
  51    ->setAll($args->getArg('all', false))
  52    ->setArc($args->getArg('arc'))
  53    ->setSeverity($args->getArg('severity'))
  54    ->setChunkSize($args->getArg('chunk-size'))
  55    ->setNeedsBlame($args->getArg('blame'))
  56    ->run('.');
  57  
  58  echo "\nProcessed {$count} files.\n";


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1