Skip to content

Commit

Permalink
Added ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Delaney committed Jun 30, 2022
1 parent 47cdae4 commit e2a3c1f
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ node_modules/

npm-debug.log

.php_cs.cache
.php-cs-fixer.cache
.ecs_cache
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"stop-on-failure": ["pre-commit"]
},
"pre-commit": [
"composer run-script phpstan"
"composer run-script phpstan",
"composer run-script ecs"
]
}
},
Expand All @@ -65,12 +66,14 @@
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.8",
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main",
"phpstan/phpstan": "^1.8"
},
"scripts": {
"cghooks": "vendor/bin/cghooks",
"phpstan": "vendor/bin/phpstan --memory-limit=1G"
"phpstan": "vendor/bin/phpstan --memory-limit=1G",
"ecs": "vendor/bin/ecs check --fix"
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
91 changes: 90 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use craft\ecs\SetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function(ECSConfig $ecsConfig): void {
$ecsConfig->paths([__DIR__ . '/src', __FILE__]);
$ecsConfig->indentation('tab');
$ecsConfig->parallel();
$ecsConfig->sets([SetList::CRAFT_CMS_4]);

$parameters = $ecsConfig->parameters();
$parameters->set(Option::CACHE_DIRECTORY, '.ecs_cache');
};

0 comments on commit e2a3c1f

Please sign in to comment.