12
12
namespace Symfony \Component \Yaml \Command ;
13
13
14
14
use Symfony \Component \Console \CI \GithubActionReporter ;
15
+ use Symfony \Component \Console \Attribute \AsCommand ;
15
16
use Symfony \Component \Console \Command \Command ;
16
17
use Symfony \Component \Console \Exception \InvalidArgumentException ;
17
18
use Symfony \Component \Console \Exception \RuntimeException ;
30
31
* @author Grégoire Pineau <[email protected] >
31
32
* @author Robin Chalas <[email protected] >
32
33
*/
34
+ #[AsCommand(name: 'lint:yaml ' , description: 'Lint a YAML file and outputs encountered errors ' )]
33
35
class LintCommand extends Command
34
36
{
35
- protected static $ defaultName = 'lint:yaml ' ;
36
- protected static $ defaultDescription = 'Lint a YAML file and outputs encountered errors ' ;
37
-
38
37
private Parser $ parser ;
39
38
private ?string $ format = null ;
40
39
private bool $ displayCorrectFiles ;
@@ -55,7 +54,6 @@ public function __construct(string $name = null, callable $directoryIteratorProv
55
54
protected function configure ()
56
55
{
57
56
$ this
58
- ->setDescription (self ::$ defaultDescription )
59
57
->addArgument ('filename ' , InputArgument::IS_ARRAY , 'A file, a directory or "-" for reading from STDIN ' )
60
58
->addOption ('format ' , null , InputOption::VALUE_REQUIRED , 'The output format ' )
61
59
->addOption ('exclude ' , null , InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY , 'Path(s) to exclude ' )
0 commit comments