Skip to content

Commit

Permalink
Merge pull request #62 from novaway/feat-tools-separation
Browse files Browse the repository at this point in the history
Separate dev-tools from project dependencies
  • Loading branch information
jdecool authored Oct 25, 2023
2 parents 33ce98e + cee3632 commit 1f917ea
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
8 changes: 6 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install --prefer-dist --no-interaction --optimize-autoloader
working-directory: ./tools
- name: Run PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --dry-run --diff
run: tools/vendor/bin/php-cs-fixer fix --dry-run --diff


phpstan:
Expand All @@ -46,10 +47,13 @@ jobs:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dev Tools
run: composer install --prefer-dist --no-interaction --optimize-autoloader
working-directory: ./tools
- name: Install Dependencies
run: composer install --prefer-dist --no-interaction --optimize-autoloader
- name: Run PHPStan
run: vendor/bin/phpstan
run: tools/vendor/bin/phpstan

tests:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.phpunit.cache/
tools/
tools/vendor/
tools/composer.lock
vendor/
.php-cs-fixer.cache
composer.lock
Expand Down
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
install: composer.install tools.install

composer.install:
composer install

clean:
rm -rf composer.lock vendor/
rm -rf tools/composer.lock tools/vendor/

tools.install:
composer -d tools install

cs:
tools/vendor/bin/php-cs-fixer fix --verbose --diff --dry-run

cs.fix:
tools/vendor/bin/php-cs-fixer fix --verbose --diff

phpstan:
tools/vendor/bin/phpstan

phpunit:
vendor/bin/phpunit
16 changes: 2 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@
"require": {
"php": ">= 8.1",
"ext-json": "*",
"symfony/console": "^5.4|^6.0",
"symfony/framework-bundle": "^5.4|^6.0",
"symfony/options-resolver": "^5.4|^6.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.7",
"phpunit/phpunit": "^10.1",
"symfony/asset": "^5.4|^6.0",
"symfony/browser-kit": "^5.4|^6.0",
Expand All @@ -38,24 +36,14 @@
"twig/twig": "To check feature in your Twig templates"
},
"autoload": {
"psr-4": {"Novaway\\Bundle\\FeatureFlagBundle\\": "src/"},
"exclude-from-classmap": ["src/Tests/"]
"psr-4": {"Novaway\\Bundle\\FeatureFlagBundle\\": "src/"}
},
"autoload-dev": {
"psr-4": {
"Novaway\\Bundle\\FeatureFlagBundle\\": "src/Tests/",
"Novaway\\Bundle\\FeatureFlagBundle\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
},
"sort-packages": true
},
"conflict": {
"symfony/dependency-injection": "<5.4",
"symfony/dom-crawler": "<5.4",
"symfony/routing": "<5.4"
}
}
16 changes: 16 additions & 0 deletions tools/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"require": {
"php": "^8.2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.7"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
},
"sort-packages": true
}
}

0 comments on commit 1f917ea

Please sign in to comment.