-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add Symfony linters * fixup! feat: Add Symfony linters * Add lint YAML * Add roave infection * Disable command timeout * chore: Update PHP ^7.4 * fixup! chore: Update PHP ^7.4
- Loading branch information
Frank Verhoeven
authored
Dec 10, 2021
1 parent
72c7dc9
commit e082a03
Showing
14 changed files
with
185 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace MyOnlineStore\DevTools\Command; | ||
|
||
use MyOnlineStore\DevTools\Configuration; | ||
use Symfony\Component\Process\Process; | ||
|
||
final class LintSymfonyContainerCommand extends DevToolsCommand | ||
{ | ||
/** @var string|null */ | ||
protected static $defaultName = 'lint-container'; | ||
|
||
/** @var string|null */ | ||
protected static $defaultDescription = 'Lint Symfony container'; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function getCommand(): array | ||
{ | ||
return [ | ||
$this->withBinPath('console'), | ||
'lint:container', | ||
]; | ||
} | ||
|
||
public static function isAvailable(Configuration $configuration): bool | ||
{ | ||
if (!\is_file($configuration->getRootDir() . 'bin/console')) { | ||
return false; | ||
} | ||
|
||
$process = new Process([$configuration->getRootDir() . 'bin/console', 'list']); | ||
$process->run(); | ||
|
||
return \str_contains($process->getOutput(), 'lint:container'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace MyOnlineStore\DevTools\Command; | ||
|
||
use MyOnlineStore\DevTools\Configuration; | ||
use Symfony\Component\Process\Process; | ||
|
||
final class LintYamlCommand extends DevToolsCommand | ||
{ | ||
/** @var string|null */ | ||
protected static $defaultName = 'lint-yaml'; | ||
|
||
/** @var string|null */ | ||
protected static $defaultDescription = 'Lint YAML'; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function getCommand(): array | ||
{ | ||
return [ | ||
$this->withBinPath('console'), | ||
'lint:yaml', | ||
'config', | ||
'--parse-tags', | ||
]; | ||
} | ||
|
||
public static function isAvailable(Configuration $configuration): bool | ||
{ | ||
if ( | ||
!\is_file($configuration->getRootDir() . 'bin/console') || | ||
!\is_dir($configuration->getRootDir() . 'config') | ||
) { | ||
return false; | ||
} | ||
|
||
$process = new Process([$configuration->getRootDir() . 'bin/console', 'list']); | ||
$process->run(); | ||
|
||
return \str_contains($process->getOutput(), 'lint:yaml'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace MyOnlineStore\DevTools\Command; | ||
|
||
use MyOnlineStore\DevTools\Configuration; | ||
|
||
final class RoaveInfectionCommand extends DevToolsCommand | ||
{ | ||
/** @var string|null */ | ||
protected static $defaultName = 'infection'; | ||
|
||
/** @var string|null */ | ||
protected static $defaultDescription = 'Roave Infection'; | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function getCommand(): array | ||
{ | ||
return [ | ||
$this->withVendorBinPath('roave-infection-static-analysis-plugin'), | ||
'--only-covered', | ||
'--show-mutations', | ||
]; | ||
} | ||
|
||
public static function isAvailable(Configuration $configuration): bool | ||
{ | ||
return \is_file($configuration->getRootDir() . 'vendor/bin/roave-infection-static-analysis-plugin') | ||
&& ( | ||
\is_file($configuration->getRootDir() . 'infection.json.dist') || | ||
\is_file($configuration->getRootDir() . 'infection.json') | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.