Skip to content

Commit de72b6a

Browse files
committed
Add brick/coding-standard
1 parent f0f0ea0 commit de72b6a

4 files changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,9 @@ jobs:
7676

7777
- name: Run Psalm
7878
run: vendor/bin/psalm --no-progress
79+
80+
coding-standard:
81+
name: Coding Standard
82+
uses: brick/coding-standard/.github/workflows/coding-standard.yml@v2
83+
with:
84+
working-directory: "tools/ecs"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
/vendor
22
/composer.lock
33
/.phpunit.result.cache
4+
5+
/tools/*
6+
!/tools/ecs/composer.json
7+
!/tools/ecs/ecs.php

tools/ecs/composer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"require": {
3+
"brick/coding-standard": "v2"
4+
},
5+
"config": {
6+
"allow-plugins": {
7+
"dealerdirect/phpcodesniffer-composer-installer": false
8+
}
9+
}
10+
}

tools/ecs/ecs.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symplify\EasyCodingStandard\Config\ECSConfig;
6+
7+
return static function (ECSConfig $ecsConfig): void {
8+
$ecsConfig->import(__DIR__ . '/vendor/brick/coding-standard/ecs.php');
9+
10+
$libRootPath = realpath(__DIR__ . '/../../');
11+
12+
$ecsConfig->paths(
13+
[
14+
$libRootPath . '/src',
15+
$libRootPath . '/tests',
16+
__FILE__,
17+
],
18+
);
19+
};

0 commit comments

Comments
 (0)