Skip to content

Commit

Permalink
Run Code style check in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
funivan committed Jan 11, 2024
1 parent a5dfc61 commit 80fd0b5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ jobs:

- name: Run rector
run: ./vendor/bin/rector --dry-run

- name: Run code style check
run: ./vendor/bin/ecs
21 changes: 21 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
__FILE__,
]);

$ecsConfig->rules([NoUnusedImportsFixer::class, VoidReturnFixer::class]);

// this way you can add sets - group of rules
$ecsConfig->sets([SetList::SPACES, SetList::ARRAY, SetList::DOCBLOCK, SetList::NAMESPACES, SetList::COMMENTS, SetList::PSR_12]);
};

0 comments on commit 80fd0b5

Please sign in to comment.