Path: blob/master/scripts/repository/save_lint.php
12241 views
#!/usr/bin/env php1<?php23require_once dirname(__FILE__).'/../__init_script__.php';45$synopsis = <<<EOT6**save_lint.php**7Discover lint problems and save them to database so that they can8be displayed in Diffusion.910EOT;1112$args = id(new PhutilArgumentParser($argv))13->setTagline(pht('save lint errors to database'))14->setSynopsis($synopsis)15->parseStandardArguments()16->parse(array(17array(18'name' => 'all',19'help' => pht(20'Discover problems in the whole repository instead of just changes '.21'since the last run.'),22),23array(24'name' => 'arc',25'param' => 'path',26'default' => 'arc',27'help' => pht('Path to Arcanist executable.'),28),29array(30'name' => 'severity',31'param' => 'string',32'default' => ArcanistLintSeverity::SEVERITY_ADVICE,33'help' => pht(34'Minimum severity, one of %s constants.',35'ArcanistLintSeverity'),36),37array(38'name' => 'chunk-size',39'param' => 'number',40'default' => 256,41'help' => pht('Number of paths passed to `%s` at once.', 'arc'),42),43array(44'name' => 'blame',45'help' => pht(46'Assign lint errors to authors who last modified the line.'),47),48));4950echo pht('Saving lint errors to database...')."\n";5152$count = id(new DiffusionLintSaveRunner())53->setAll($args->getArg('all', false))54->setArc($args->getArg('arc'))55->setSeverity($args->getArg('severity'))56->setChunkSize($args->getArg('chunk-size'))57->setNeedsBlame($args->getArg('blame'))58->run('.');5960echo "\n".pht('Processed %d files.', $count)."\n";616263