-
-
Notifications
You must be signed in to change notification settings - Fork 695
[Kocal/SymfonyAppPack] Add recipe #1936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
symfony-recipes-bot
merged 2 commits into
symfony:main
from
Kocal:kocal/symfony-app-pack
Feb 10, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,11 @@ | ||
| # To get started with Dependabot version updates, you'll need to specify which | ||
| # package ecosystems to update and where the package manifests are located. | ||
| # Please see the documentation for all configuration options: | ||
| # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
|
||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "composer" # See documentation for possible values | ||
| directory: "/" # Location of package manifests | ||
| schedule: | ||
| interval: "weekly" |
This file contains hidden or 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,41 @@ | ||
| name: CI | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [ opened, synchronize, reopened, ready_for_review ] | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| qa: | ||
| if: ${{ ! github.event.pull_request.draft }} | ||
| name: Quality Assurance | ||
| timeout-minutes: 10 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup PHP | ||
| uses: shivammathur/setup-php@v2 | ||
| with: | ||
| extensions: ctype, iconv, mbstring | ||
| tools: symfony | ||
|
|
||
| - name: Start Docker containers | ||
| run: docker compose up -d --wait | ||
|
|
||
| - name: Install project | ||
| run: make app.install | ||
|
|
||
| - name: QA | ||
| run: make qa |
This file contains hidden or 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,10 @@ | ||
| <?php | ||
|
|
||
| $ruleset = new TwigCsFixer\Ruleset\Ruleset(); | ||
| $ruleset->addStandard(new TwigCsFixer\Standard\Symfony()); | ||
|
|
||
| $config = new TwigCsFixer\Config\Config(); | ||
| $config->setCacheFile(__DIR__.'/tools/.cache/twig-cs-fixer'); | ||
| $config->setRuleset($ruleset); | ||
|
|
||
| return $config; |
This file contains hidden or 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,180 @@ | ||
| ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
| include $(ROOT_DIR)/tools/make/text.mk | ||
| include $(ROOT_DIR)/tools/make/help.mk | ||
| include $(ROOT_DIR)/tools/make/os.mk | ||
| include $(ROOT_DIR)/tools/make/git.mk | ||
|
|
||
| .DEFAULT_GOAL := help | ||
|
|
||
| # Executables | ||
| SF := symfony | ||
| SF_PROXY = $(shell $(SF) local:proxy:url) | ||
| SF_CONSOLE := $(SF) console | ||
| PHP := $(SF) php | ||
| COMPOSER := $(SF) composer | ||
|
|
||
| UID := $(shell id -u) | ||
| GID := $(shell id -g) | ||
| DC := USER_ID=$(UID) GROUP_ID=$(GID) docker compose --env-file /dev/null | ||
|
|
||
| ## Install everything needed to start the project | ||
| install: | ||
| $(SF) local:server:ca:install | ||
| $(MAKE) start | ||
| $(MAKE) app.install | ||
|
|
||
| ## Start the environment | ||
| start: | ||
| $(DC) up -d | ||
| $(SF) proxy:start | ||
| $(SF) serve | ||
|
|
||
| ## Stop the environment | ||
| stop: | ||
| $(DC) kill | ||
|
|
||
| ## Stop and delete the environment and project data (database, logs, etc.) | ||
| delete: | ||
| $(DC) down -v --remove-orphans | ||
|
|
||
| ## App - Install the application | ||
| app.install: | ||
| @$(call action, Installing PHP dependencies...) | ||
| $(COMPOSER) install --prefer-dist | ||
|
|
||
| @$(call action, Running DB migrations...) | ||
| $(SF_CONSOLE) doctrine:migrations:migrate --no-interaction --all-or-nothing | ||
|
|
||
| ## App - Install the application (alias to "make app.install") | ||
| app.update: app.install | ||
|
|
||
| ###### | ||
| # QA # | ||
| ###### | ||
|
|
||
| ## QA - Run all QA checks | ||
| qa: archi refactor cs lint phpstan test | ||
|
|
||
| ## QA - Run all QA checks and fix issues | ||
| qa.fix: archi refactor.fix cs.fix lint.fix phpstan test | ||
|
|
||
| ######### | ||
| # Archi # | ||
| ######### | ||
|
|
||
| ## Architecture - Run architecture checks | ||
| archi: archi.back | ||
|
|
||
| ## Architecture - Run architecture checks for backend | ||
| archi.back: | ||
| $(PHP) vendor/bin/deptrac --report-uncovered --fail-on-uncovered | ||
|
|
||
| ############ | ||
| # Refactor # | ||
| ############ | ||
|
|
||
| ## Refactor - Run all refactor checks | ||
| refactor: refactor.back | ||
|
|
||
| ## Refactor - Run all refactor checks and fix issues | ||
| refactor.fix: refactor.back.fix | ||
|
|
||
| ## Refactor - Run refactor checks for backend | ||
| refactor.back: | ||
| $(PHP) vendor/bin/rector process --dry-run | ||
|
|
||
| ## Refactor - Run refactor checks for backend and fix issues | ||
| refactor.back.fix: | ||
| $(PHP) vendor/bin/rector process | ||
|
|
||
| ################ | ||
| # Coding style # | ||
| ################ | ||
|
|
||
| ## Coding style - Run all coding style checks | ||
| cs: cs.back cs.front | ||
|
|
||
| ## Coding style - Run all coding style checks and fix issues | ||
| cs.fix: cs.back.fix cs.front.fix | ||
|
|
||
| ## Coding style - Check backend coding style | ||
| cs.back: | ||
| $(PHP) vendor/bin/ecs check | ||
| $(PHP) vendor/bin/twig-cs-fixer | ||
|
|
||
| ## Coding style - Check backend coding style and fix issues | ||
| cs.back.fix: | ||
| $(PHP) vendor/bin/ecs check --fix | ||
| $(PHP) vendor/bin/twig-cs-fixer --fix | ||
|
|
||
| ## Coding style - Check frontend coding style | ||
| cs.front: bin/oxfmt | ||
| bin/oxfmt --check | ||
|
|
||
| ## Coding style - Check frontend coding style and fix issues | ||
| cs.front.fix: bin/oxfmt | ||
| bin/oxfmt | ||
|
|
||
| bin/oxfmt: | ||
| @$(call action, Downloading oxfmt...) | ||
| $(SF_CONSOLE) oxc:download:oxfmt | ||
| @$(call success, oxfmt downloaded successfully) | ||
|
|
||
| ########## | ||
| # Linter # | ||
| ########## | ||
|
|
||
| ## Linter - Run all linters | ||
| lint: lint.back lint.front | ||
|
|
||
| ## Linter - Run all linters and fix issues | ||
| lint.fix: lint.back lint.front.fix | ||
|
|
||
| ## Linter - Run linters for backend | ||
| lint.back: | ||
| $(SF_CONSOLE) lint:container | ||
| $(SF_CONSOLE) lint:xliff translations | ||
| $(SF_CONSOLE) lint:yaml --parse-tags config | ||
| $(SF_CONSOLE) lint:twig templates | ||
| #$(SF_CONSOLE) doctrine:schema:validate | ||
|
|
||
| ## Linter - Lint front files | ||
| lint.front: bin/oxlint | ||
| bin/oxlint | ||
|
|
||
| ## Linter - Lint front files and fix issues | ||
| lint.front.fix: bin/oxlint | ||
| bin/oxlint --fix | ||
|
|
||
| bin/oxlint: | ||
| @$(call action, Downloading oxlint...) | ||
| $(SF_CONSOLE) oxc:download:oxlint | ||
|
|
||
| ########### | ||
| # PHPStan # | ||
| ########### | ||
|
|
||
| ## PHPStan - Run PHPStan | ||
| phpstan: | ||
| $(PHP) vendor/bin/phpstan analyse | ||
|
|
||
| ## PHPStan - Run PHPStan and update the baseline | ||
| phpstan.generate-baseline: | ||
| $(PHP) vendor/bin/phpstan analyse --generate-baseline | ||
|
|
||
| ######### | ||
| # Tests # | ||
| ######### | ||
|
|
||
| ## Tests - Run all tests | ||
| test: test.back | ||
|
|
||
| ## Tests - Run backend tests | ||
| test.back: | ||
| $(PHP) vendor/bin/phpunit | ||
| ## Tests - Run backend tests with coverage | ||
|
|
||
| test.back.coverage: | ||
| $(PHP) vendor/bin/phpunit --coverage-html .cache/phpunit/coverage-html | ||
|
|
||
| -include $(ROOT_DIR)/Makefile.local |
This file contains hidden or 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 @@ | ||
| # Local targets that should not be committed to git |
This file contains hidden or 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,29 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| use Symplify\EasyCodingStandard\Config\ECSConfig; | ||
|
|
||
| return ECSConfig::configure() | ||
| ->withParallel() | ||
| ->withCache(__DIR__ . '/tools/.cache/ecs') | ||
| ->withPaths([ | ||
| __DIR__ . '/assets', | ||
| __DIR__ . '/config', | ||
| __DIR__ . '/public', | ||
| __DIR__ . '/src', | ||
| __DIR__ . '/tests', | ||
| __DIR__ . '/tools', | ||
| ]) | ||
| ->withSkip([ | ||
| __DIR__ . '/tools/.cache', | ||
| __DIR__ . '/config/bundles.php', | ||
| __DIR__ . '/config/reference.php', | ||
| ]) | ||
| ->withPreparedSets( | ||
| psr12: true, | ||
| common: true, | ||
| strict: true, | ||
| cleanCode: true, | ||
| ) | ||
| ; |
This file contains hidden or 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,15 @@ | ||
| { | ||
| "copy-from-recipe": { | ||
| ".github/": ".github/", | ||
| "tools/": "tools/", | ||
| ".twig-cs-fixer.php": ".twig-cs-fixer.php", | ||
| "ecs.php": "ecs.php", | ||
| "Makefile.local": "Makefile.local", | ||
| "php.ini": "php.ini", | ||
| "phpstan.dist.neon": "phpstan.dist.neon", | ||
| "rector.php": "rector.php" | ||
| }, | ||
| "gitignore": [ | ||
| "/Makefile.local" | ||
| ] | ||
| } |
This file contains hidden or 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 @@ | ||
| memory_limit = -1 |
This file contains hidden or 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,36 @@ | ||
| includes: | ||
| - vendor/kocal/phpstan-symfony-ux/extension.neon | ||
| - vendor/phpstan/phpstan-symfony/extension.neon | ||
| - vendor/phpstan/phpstan-doctrine/extension.neon | ||
| - tools/phpstan/symfony-configuration.php | ||
|
|
||
| parameters: | ||
| level: 9 | ||
| paths: | ||
| - bin/ | ||
| - config/ | ||
| - public/ | ||
| - src/ | ||
| - tools/ | ||
| - tests/ | ||
| excludePaths: | ||
| - config/reference.php | ||
| - tools/.cache | ||
|
|
||
| tmpDir: tools/.cache/phpstan | ||
|
|
||
| symfony: | ||
| consoleApplicationLoader: tools/phpstan/console-application.php | ||
|
|
||
| doctrine: | ||
| objectManagerLoader: tools/phpstan/object-manager.php | ||
|
|
||
| rules: | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ClassMustBeFinalRule | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ClassNameMustNotEndWithComponentRule | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ForbiddenAttributesPropertyRule | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\ForbiddenClassPropertyRule | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\MethodsVisibilityRule | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\PostMountMethodSignatureRule | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\PreMountMethodSignatureRule | ||
| - Kocal\PHPStanSymfonyUX\Rules\TwigComponent\PublicPropertiesMustBeCamelCaseRule |
This file contains hidden or 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,37 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| use Rector\Config\RectorConfig; | ||
| use Rector\Symfony\CodeQuality\Rector\Class_\ControllerMethodInjectionToConstructorRector; | ||
|
|
||
| return RectorConfig::configure() | ||
| ->withParallel() | ||
| ->withCache(__DIR__ . '/tools/.cache/rector') | ||
| ->withPaths([ | ||
| __DIR__ . '/config', | ||
| __DIR__ . '/public', | ||
| __DIR__ . '/src', | ||
| __DIR__ . '/tests', | ||
| __DIR__ . '/tools', | ||
| ]) | ||
| ->withPhpSets() | ||
| ->withPreparedSets( | ||
| deadCode: true, | ||
| codeQuality: true, | ||
| codingStyle: true, | ||
| typeDeclarations: true, | ||
| privatization: true, | ||
| instanceOf: true, | ||
| earlyReturn: true, | ||
| phpunitCodeQuality: true, | ||
| doctrineCodeQuality: true, | ||
| symfonyCodeQuality: true, | ||
| ) | ||
| ->withSkip([ | ||
| __DIR__ . '/config/bundles.php', | ||
| __DIR__ . '/config/reference.php', | ||
| __DIR__ . '/tools/.cache', | ||
| ControllerMethodInjectionToConstructorRector::class, | ||
| ]) | ||
| ; |
This file contains hidden or 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 @@ | ||
| .cache/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
Makefileis not part of manifest, please either add to manifest or remove from PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Makefile can not be part of the manifest, please see #1936 (comment)