-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andru Cherny
committed
Jun 7, 2021
1 parent
3b3bf46
commit e0b956a
Showing
17 changed files
with
666 additions
and
74 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
.PHONY: lint layer style coding-standards | ||
static-analysis: lint layer style coding-standards ## Run phpstan, deprac, easycoding standarts code static analysis | ||
|
||
.PHONY: phpstan psalm | ||
style: phpstan psalm ## executes php analizers | ||
|
||
|
||
.PHONY: lint | ||
lint: ## checks syntax of PHP files | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/parallel-lint ./ --exclude vendor' | ||
|
||
.PHONY: layer | ||
layer: ## check issues with layers (deptrac tool) | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/deptrac analyze' | ||
|
||
.PHONY: coding-standards | ||
coding-standards: ## run check and validate code standards tests | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/ecs check src tests' | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/phpmd src/ text phpmd.xml' | ||
|
||
.PHONY: coding-standards-fixer | ||
coding-standards-fixer: ## run code standards fixer | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/ecs check src tests --fix' | ||
|
||
tests-unit: ## Run unit-tests suite | ||
docker-compose run --rm --no-deps php sh -lc 'vendor/bin/phpunit --configuration /app/phpunit.xml.dist' | ||
|
||
tests-integration: ## Run integration-tests suite | ||
docker-compose run --rm --no-deps php sh -lc 'vendor/bin/phpunit --configuration /app/phpunit.func.xml' | ||
|
||
.PHONY: infection | ||
infection: ## executes mutation framework infection | ||
docker-compose run --rm --no-deps php-fpm sh -lc './vendor/bin/infection --min-msi=70 --min-covered-msi=80 --threads=$(JOBS) --coverage=var/report' | ||
|
||
.PHONY: phpstan | ||
phpstan: ## phpstan - PHP Static Analysis Tool | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/phpstan analyse -l 6 -c phpstan.neon src tests' | ||
|
||
.PHONY: psalm | ||
psalm: ## psalm is a static analysis tool for finding errors in PHP applications | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/psalm --config=psalm.xml' | ||
|
||
.PHONY: psalm-fixer | ||
psalm-fixer: ## psalm is a static analysis tool for finding errors in PHP applications | ||
docker-compose run --rm --no-deps php sh -lc './vendor/bin/psalm --config=psalm.xml --alter --issues=MissingParamType --dry-run' | ||
|
||
.PHONY: phan | ||
phan: ## phan is a static analyzer for PHP that prefers to minimize false-positives. | ||
docker-compose run --rm --no-deps php sh -lc 'PHAN_DISABLE_XDEBUG_WARN=1 PHAN_ALLOW_XDEBUG=1 php -d zend.enable_gc=0 ./vendor/bin/phan --config-file phan.php --require-config-exists' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; | ||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | ||
use Symplify\EasyCodingStandard\ValueObject\Option; | ||
use Symplify\EasyCodingStandard\ValueObject\Set\SetList; | ||
|
||
|
||
return static function (ContainerConfigurator $containerConfigurator): void { | ||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::PATHS, [ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]); | ||
|
||
$services = $containerConfigurator->services(); | ||
$services->set(ArraySyntaxFixer::class) | ||
->call('configure', [[ | ||
'syntax' => 'short', | ||
]]); | ||
|
||
// run and fix, one by one | ||
$containerConfigurator->import(SetList::CLEAN_CODE); | ||
$containerConfigurator->import(SetList::SYMFONY); | ||
$containerConfigurator->import(SetList::PHP_71); | ||
$containerConfigurator->import(SetList::PHP_73_MIGRATION); | ||
$containerConfigurator->import(SetList::PSR_12); | ||
|
||
$parameters = $containerConfigurator->parameters(); | ||
$parameters->set(Option::SKIP, [ | ||
\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class => null, | ||
\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer::class => null, | ||
\PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer::class => null, | ||
\SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff::class => null, | ||
\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class => null | ||
]); | ||
}; |
Oops, something went wrong.