Skip to content

Commit

Permalink
Refactor castor validation and integrate tasks in workflows
Browse files Browse the repository at this point in the history
The code refactors the validation of the composer configuration and autoload dumping in the 'castor.php' file. It also modifies the '.github/workflows/integrate.yml' to replace previous tasks with equivalent 'castor' commands for validation, testing, static analysis, code style checking, Deptrac analysis, and make rector. Additionally, '.castor.stub.php' is added to the '.gitignore' file to prevent it from being tracked.
  • Loading branch information
Spomky committed Apr 13, 2024
1 parent f2db9e4 commit 8666923
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
/CODE_OF_CONDUCT.md export-ignore
/deptrac.yaml export-ignore
/ecs.php export-ignore
/infection.json.dist export-ignore
/infection.json export-ignore
/Makefile export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/phpunit.xml.dist export-ignore
/rector.php export-ignore
/castor.php export-ignore
11 changes: 4 additions & 7 deletions castor.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,12 @@ function validate(): void
{
io()->title('Validating Composer configuration');
$command = ['composer', 'validate', '--strict'];
$environment = ['XDEBUG_MODE' => 'off'];
$environment = [
'XDEBUG_MODE' => 'off',
];
run($command, environment: $environment);

$command = [
'composer',
'dump-autoload',
'--optimize',
'--strict-psr'
];
$command = ['composer', 'dump-autoload', '--optimize', '--strict-psr'];
run($command, environment: $environment);
}

Expand Down
8 changes: 7 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
$config->parallel();
$config->paths([__DIR__]);
$config->skip(
[__DIR__ . '/.github', __DIR__ . '/build', __DIR__ . '/vendor', PhpUnitTestClassRequiresCoversFixer::class]
[
__DIR__ . '/.github',
__DIR__ . '/build',
__DIR__ . '/vendor',
__DIR__ . '/.castor.stub.php',
PhpUnitTestClassRequiresCoversFixer::class,
]
);
};

0 comments on commit 8666923

Please sign in to comment.