Skip to content

Commit

Permalink
Check for composer dependency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jdreesen committed Aug 9, 2024
1 parent 7612b25 commit d68c467
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ jobs:
- name: Install dependencies
uses: ramsey/composer-install@v2

- name: Run ergebnis/composer-normalize
run: composer normalize --ansi --dry-run
- name: Normalize composer.json
run: composer normalize --ansi --dry-run --no-check-lock --no-update-lock

- name: Check CS-Fixer
- name: Check dependency issues
run: composer dependencies:check

- name: Check CS
run: composer cs:check

- name: Check PHPStan
Expand Down
16 changes: 16 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

return (new Configuration())
// Exclude test app
->addPathToExclude(__DIR__ . '/tests/app')

// Ignore optional dependency
->ignoreErrorsOnPackageAndPath('dama/doctrine-test-bundle', __DIR__ . '/src/Database/ResetDatabase.php', [ErrorType::DEV_DEPENDENCY_IN_PROD])
->ignoreErrorsOnPackageAndPath('dama/doctrine-test-bundle', __DIR__ . '/src/Database/DatabaseResetter.php', [ErrorType::DEV_DEPENDENCY_IN_PROD])

// Ignore a legacy class from Pimcore 10
->ignoreUnknownClasses([Pimcore\Bundle\AdminBundle\PimcoreAdminBundle::class])
;
15 changes: 11 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@
"phpunit/phpunit": "^9.6.0",
"pimcore/pimcore": "^10.5 || ~11.0.0 || ~11.1.0 || ~11.2.2",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/console": "^5.4 || ^6.2",
"symfony/filesystem": "^5.4 || ^6.2",
"symfony/framework-bundle": "^5.4 || ^6.2"
"symfony/config": "^5.4 || ^6.4",
"symfony/console": "^5.4 || ^6.4",
"symfony/dependency-injection": "^5.4 || ^6.4",
"symfony/event-dispatcher": "^5.4 || ^6.4",
"symfony/filesystem": "^5.4 || ^6.4",
"symfony/framework-bundle": "^5.4 || ^6.4",
"symfony/http-kernel": "^5.4 || ^6.4"
},
"require-dev": {
"dama/doctrine-test-bundle": "^6.0 || ^7.0",
Expand All @@ -38,7 +42,8 @@
"phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.10.60",
"phpstan/phpstan-phpunit": "^1.3.16",
"phpstan/phpstan-symfony": "^1.3.8"
"phpstan/phpstan-symfony": "^1.3.8",
"shipmonk/composer-dependency-analyser": "^1.7"
},
"suggest": {
"dama/doctrine-test-bundle": "To isolate database tests in transactions and improve test performance",
Expand Down Expand Up @@ -67,6 +72,7 @@
"cs:check": "@cs:fix --dry-run",
"cs:check:gitlab-ci": "php-cs-fixer fix --dry-run --ansi --verbose --diff --format=gitlab > .reports/php-cs-fixer.json",
"cs:fix": "php-cs-fixer fix --ansi --verbose --diff",
"dependencies:check": "composer-dependency-analyser",
"phpstan": "phpstan analyse --ansi",
"phpstan:gitlab-ci": "phpstan analyse --ansi --no-interaction --no-progress --error-format=gitlab > .reports/phpstan.json",
"tests": "phpunit",
Expand All @@ -76,6 +82,7 @@
"cs:check": "Checks code style (but doesn't fix anything)",
"cs:check:gitlab-ci": "Checks code style and redirects the output into a GitLab readable file",
"cs:fix": "Checks and fixes code style",
"dependencies:check": "Checks for composer dependency issues",
"phpstan": "Checks for code smells",
"phpstan:gitlab-ci": "Checks for code smells and redirects the output into a GitLab readable file",
"tests": "Run all phpunit tests",
Expand Down

0 comments on commit d68c467

Please sign in to comment.