-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathConfiguresForLintOrFix.php
More file actions
47 lines (43 loc) · 1.64 KB
/
ConfiguresForLintOrFix.php
File metadata and controls
47 lines (43 loc) · 1.64 KB
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
<?php
namespace App\Concerns;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
trait ConfiguresForLintOrFix
{
protected function configure(): void
{
parent::configure();
$this
->setDefinition(
[
new InputArgument(
name: 'path',
mode: InputArgument::IS_ARRAY,
description: 'The path to lint/fix',
default: [(string) getcwd()],
),
new InputOption(
name: 'using',
shortcut: 'u',
mode: InputOption::VALUE_REQUIRED,
description: 'Lint/fix using specified (comma separated) tools: tlint,phpcodesniffer,phpcsfixer,pint',
),
new InputOption(
name: 'dirty',
mode: InputOption::VALUE_NONE,
description: 'Only lint/fix files that have uncommitted changes'
),
new InputOption(
name: 'diff',
mode: InputOption::VALUE_REQUIRED,
description: 'Only fix files that have changed since branching off from the given branch',
),
new InputOption(
name: 'exclude',
mode: InputOption::VALUE_REQUIRED,
description: 'Exclude paths (comma separated)',
),
]
);
}
}