Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/scripts/repository/save_lint.php
12241 views
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(pht('save lint errors to database'))
15
->setSynopsis($synopsis)
16
->parseStandardArguments()
17
->parse(array(
18
array(
19
'name' => 'all',
20
'help' => pht(
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' => pht('Path to Arcanist executable.'),
29
),
30
array(
31
'name' => 'severity',
32
'param' => 'string',
33
'default' => ArcanistLintSeverity::SEVERITY_ADVICE,
34
'help' => pht(
35
'Minimum severity, one of %s constants.',
36
'ArcanistLintSeverity'),
37
),
38
array(
39
'name' => 'chunk-size',
40
'param' => 'number',
41
'default' => 256,
42
'help' => pht('Number of paths passed to `%s` at once.', 'arc'),
43
),
44
array(
45
'name' => 'blame',
46
'help' => pht(
47
'Assign lint errors to authors who last modified the line.'),
48
),
49
));
50
51
echo pht('Saving lint errors to database...')."\n";
52
53
$count = id(new DiffusionLintSaveRunner())
54
->setAll($args->getArg('all', false))
55
->setArc($args->getArg('arc'))
56
->setSeverity($args->getArg('severity'))
57
->setChunkSize($args->getArg('chunk-size'))
58
->setNeedsBlame($args->getArg('blame'))
59
->run('.');
60
61
echo "\n".pht('Processed %d files.', $count)."\n";
62
63