Skip to content

Commit d215838

Browse files
committed
Adds a flavour option
1 parent 1bbafa7 commit d215838

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1111

1212
### Added
1313
- Expanded the `validation` to also validate __negated__ export-ignore directives. Closes [#70](https://github.com/raphaelstolt/lean-package-validator/issues/70).
14+
- New `flavour` option for the `create` command which influences the `.gitattributes` generation. Closes [#71](https://github.com/raphaelstolt/lean-package-validator/issues/71).
1415

1516
## [v5.9.1] - 2026-05-17
1617

src/Commands/CreateCommand.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,25 @@ protected function configure(): void
5555
$this->addAgenticOutputOption(function (...$args) {
5656
$this->getDefinition()->addOption(new InputOption(...$args));
5757
});
58+
$flavourDescription = 'Generate the .gitattributes file with the given flavour';
59+
60+
$this->addOption('flavour', 'f', InputOption::VALUE_OPTIONAL, $flavourDescription, 'classic');
5861
}
5962

6063
protected function execute(InputInterface $input, OutputInterface $output): int
6164
{
6265
$directory = (string) $input->getArgument('directory') ?: \getcwd();
6366
$this->analyser->setDirectory($directory);
67+
6468
$isAgenticRun = $this->isAgenticRun($input);
6569

70+
$generationFlavour = $input->getOption('flavour') ?: 'classic';
71+
72+
if ($generationFlavour && !\in_array($generationFlavour, ['classic', 'negated'], true)) {
73+
$output->writeln('<error>Invalid flavour specified. Use <info>classic</info> or <info>negated</info>".</error>');
74+
return self::FAILURE;
75+
}
76+
6677
// Apply options that influence generation
6778
if (!$this->applyGenerationOptions($input, $output, $this->analyser)) {
6879
return self::FAILURE;

0 commit comments

Comments
 (0)