Skip to content

Commit 34e4c69

Browse files
authored
Merge pull request #221 from mlocati/fix-composer-scripts
Fix composer scripts and check composer files
2 parents 0b63daf + e20e6bc commit 34e4c69

File tree

9 files changed

+27
-48
lines changed

9 files changed

+27
-48
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/features/ export-ignore
2+
/tests/ export-ignore
3+
/.* export-ignore
4+
/behat.yml export-ignore
5+
/box.json.dist export-ignore
6+
/MAINTAINERS.md export-ignore

.github/workflows/create-draft-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
env:
1313
RELEASE_NAME: ""
14-
PATHS_FOR_RELEASE_NOTES: "box.json composer.json src/"
14+
PATHS_FOR_RELEASE_NOTES: "box.json.dist composer.json src/"
1515
steps:
1616
- name: Check tag format
1717
if: github.event_name == 'create' && github.event.ref_type == 'tag'

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ jobs:
3434
uses: actions/checkout@v2
3535
with:
3636
fetch-depth: 0
37+
- name: Check validity of composer files
38+
run: composer valid --strict --ansi --no-interaction
3739
- name: Install Composer dependencies (including dev, preferring source)
3840
run: composer install --prefer-source --optimize-autoloader --ansi --no-interaction
3941
- name: Check coding style
4042
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '7.2'
41-
run: ./vendor/bin/php-cs-fixer fix --path-mode=intersection --config=./.php_cs.dist --dry-run --using-cache=no --diff --diff-format=udiff --ansi --no-interaction .
43+
run: composer run cs-check -- --using-cache=no --no-interaction
4244
- name: Run Atoum
4345
run: php ./vendor/atoum/atoum/scripts/coverage.php --format xml --output clover.xml
4446
- name: Install Composer dependencies (excluding dev)

.gitignore

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
composer.phar
2-
pickle*.phar
3-
vendor/
4-
*.test
5-
/clover.xml
6-
/ocular.phar
1+
/vendor/
2+
/*.phar
3+
/.php_cs
74
/.php_cs.cache
5+
/box.json
6+
/clover.xml

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,16 @@ To ensure a consistent code base, you should make sure the code follows
136136
the [PSR-1](http://www.php-fig.org/psr/psr-1/) and
137137
[PSR-2](http://www.php-fig.org/psr/psr-2/) coding standards.
138138

139-
To avoid CS issues, you should use [php-cs-fixer](http://cs.sensiolabs.org/):
139+
To check CS issues, you can use the `cs-check` composer command:
140140

141141
```sh
142-
$ php-cs-fixer fix src/
142+
$ composer run cs-check
143+
```
144+
145+
To automatically fix CS issues, you can use the `cs-fix` composer command:
146+
147+
```sh
148+
$ composer run cs-fix
143149
```
144150

145151
Support

bin/pickle.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@php "%~dpn0" %*

box.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

box.phar

-939 KB
Binary file not shown.

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@
5252
"discard-changes": true
5353
},
5454
"scripts": {
55-
"cs": "vendor/bin/php-cs-fixer --ansi fix --config=sf23",
56-
"test": "vendor/bin/atoum --force-terminal && vendor/bin/behat --suite pickle --colors"
55+
"cs-fix": "php-cs-fixer fix --path-mode=intersection --config=./.php_cs.dist --ansi .",
56+
"cs-check": "php-cs-fixer fix --path-mode=intersection --config=.php_cs.dist --ansi --dry-run --diff --diff-format=udiff .",
57+
"test": "atoum --force-terminal && ./vendor/bin/behat --suite pickle --colors"
5758
},
5859
"extra": {
5960
"patches": {

0 commit comments

Comments
 (0)