Skip to content

Commit

Permalink
Taskfile: Add lint tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsche committed Oct 11, 2024
1 parent 1624452 commit e918851
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ stan: var/cache/dev/App_KernelDevDebugContainer.xml ## Run PHPStan

# PHPStan needs the dev/debug cache
var/cache/dev/App_KernelDevDebugContainer.xml:
APP_DEBUG=1 APP_ENV=DEV bin/console cache:warmup
APP_DEBUG=1 APP_ENV=dev bin/console cache:warmup

fix-php: ## Fix PHP files with php-cs-fixer (ignore PHP 8.2 warning)
@PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix $(PHP_CS_FIXER_ARGS)
Expand Down
49 changes: 49 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,55 @@ tasks:
preconditions:
- test -f var/coverage/index.html

## —— Coding standards/lints ✨ ————————————————————————————————————————————————
stan:
desc: Run PHPStan
cmds:
- APP_DEBUG=1 APP_ENV=dev bin/console cache:warmup
- vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 1G -vv

fix-php:
desc: Fix PHP files with php-cs-fixer (ignore PHP 8.2 warning)
cmd: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix

lint-php:
desc: Lint PHP files with php-cs-fixer (report only)
cmd: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run

lint-container:
desc: Lint the Symfony DI container
cmd: bin/console lint:container

lint-twig:
desc: Lint Twig files
cmd: bin/console lint:twig templates/

lint-yaml:
desc: Lint YAML files
cmd: bin/console lint:yaml --parse-tags config/

cs:
desc: Run all CS checks
cmds:
- task: fix-php
- task: stan

lint:
desc: Run all lints
cmds:
- task: lint-php
- task: lint-container
- task: lint-twig
- task: lint-yaml

ci:
desc: Run CI locally
cmds:
- task: coverage
- task: warmup
- task: cs
- task: lint

## —— Other tools and helpers 🔨 ———————————————————————————————————————————————
versions:
desc: Display current stack versions
Expand Down

0 comments on commit e918851

Please sign in to comment.