Skip to content

Commit

Permalink
feat: Add phpstan and ecs code linting
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jan 31, 2024
1 parent 14baab9 commit 49f83f8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
"homepage": "https://nystudio107.com"
}
],
"require-dev": {
"codeception/codeception": "^3.0",
"vlucas/phpdotenv": "^3.0"
},
"require": {
"craftcms/cms": "^3.2.0",
"nystudio107/craft-plugin-vite": "^1.0.31",
Expand All @@ -40,7 +36,17 @@
"davechild/textstatistics": "1.0.2",
"sunra/php-simple-html-dom-parser": "^1.5.2"
},
"require-dev": {
"codeception/codeception": "^3.0",
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main",
"craftcms/rector": "dev-main",
"vlucas/phpdotenv": "^3.0"
},
"scripts": {
"phpstan": "vendor/bin/phpstan --ansi --memory-limit=1G",
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --fix --ansi",
"test": "codecept run unit --coverage-xml"
},
"config": {
Expand Down
13 changes: 13 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

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

return static function(ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__FILE__,
]);
$ecsConfig->parallel();
$ecsConfig->sets([SetList::CRAFT_CMS_3]);
};
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- vendor/craftcms/phpstan/phpstan.neon

parameters:
level: 5
paths:
- src

0 comments on commit 49f83f8

Please sign in to comment.