1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#!/usr/bin/env php
<?php
declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use Shirabe\Lint\Linters\CargoWorkspaceDependencies;
use Shirabe\Lint\Linters\ComposerPin;
use Shirabe\Lint\Linters\ContiguousUseBlock;
use Shirabe\Lint\Linters\NoBannedUse;
use Shirabe\Lint\Linters\NoDecorativeSectionComment;
use Shirabe\Lint\Linters\NoDirectEnvAccess;
use Shirabe\Lint\Linters\NoExceptionDowncast;
use Shirabe\Lint\Linters\NoFormatTrailingComma;
use Shirabe\Lint\Linters\NoHaltCompilerLiteral;
use Shirabe\Lint\Linters\NoModRs;
use Shirabe\Lint\Linters\NoStdCollectionsMaps;
use Shirabe\Lint\Linters\NoUseAsAlias;
use Shirabe\Lint\Linters\PhpSrcDerivationBoundary;
use Shirabe\Lint\Linters\SortedDependencies;
use Shirabe\Lint\Runner;
$rootDir = dirname(__DIR__, 2);
$runner = new Runner($rootDir, [
[new CargoWorkspaceDependencies(), []],
[new ComposerPin(), []],
[new ContiguousUseBlock(), []],
[new NoBannedUse(), []],
[new NoDecorativeSectionComment(), [
'crates/shirabe-semver/src/version_parser.rs',
]],
[new NoDirectEnvAccess(), [
// Defines the shim the rule points at.
'crates/shirabe-php-shim/src/env.rs',
// Build scripts read Cargo's own variables, and run before the shim exists.
'crates/shirabe-php-rpc/build.rs',
'crates/shirabe/build.rs',
]],
[new NoExceptionDowncast(), [
// Defines the box and the walk the rule points at.
'crates/shirabe-php-shim/src/exception.rs',
// Downcast a panic payload, not an error: PHP's error handler throws an \ErrorException
// where these call sites `catch` it.
'crates/shirabe/src/cache.rs',
'crates/shirabe/src/util/filesystem.rs',
]],
[new NoFormatTrailingComma(), [
'crates/shirabe/src/package/loader/root_package_loader.rs',
'crates/shirabe-spdx-licenses/src/spdx_licenses.rs',
]],
[new NoHaltCompilerLiteral(), [
'crates/shirabe-php-rpc/build.rs',
]],
[new NoModRs(), []],
[new NoStdCollectionsMaps(), []],
[new NoUseAsAlias(), []],
[new PhpSrcDerivationBoundary(), []],
[new SortedDependencies(), []],
]);
exit($runner->run() ? 0 : 1);
|