Skip to content

Commit 4c020cd

Browse files
Merge pull request #56 from stevegrunwell/update/composer-scripts
Rename the individual Composer scripts, update docs
2 parents 1c6b4a7 + 3d330cf commit 4c020cd

File tree

5 files changed

+39
-24
lines changed

5 files changed

+39
-24
lines changed

.github/CONTRIBUTING.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Begin by cloning the GitHub repo locally and installing the dependencies with [C
99

1010
```sh
1111
# Clone the repository + change into the directory
12-
$ git clone https://github.com/stevegrunwell/phpunit-markup-assertions.git \
13-
&& cd phpunit-markup-assertions
12+
git clone https://github.com/stevegrunwell/phpunit-markup-assertions.git \
13+
&& cd phpunit-markup-assertions;
1414

1515
# Install local dependencies
16-
$ composer install
16+
composer install
1717
```
1818

1919

@@ -23,12 +23,12 @@ Pull requests should be based off the `develop` branch, which represents the cur
2323

2424
To create a new feature branch:
2525

26-
```bash
26+
```sh
2727
# Start on develop, making sure it's up-to-date
28-
$ git checkout develop && git pull
28+
git checkout develop && git pull;
2929

3030
# Create a new branch for your feature
31-
$ git checkout -b feature/my-cool-new-feature
31+
git checkout -b feature/my-cool-new-feature
3232
```
3333

3434
When submitting a new pull request, your `feature/my-cool-new-feature` should be compared against `develop`.
@@ -38,13 +38,19 @@ When submitting a new pull request, your `feature/my-cool-new-feature` should be
3838

3939
This project uses [the PSR-2 coding standards](http://www.php-fig.org/psr/psr-2/).
4040

41+
Standards are enforced via [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/), which can be run any time with the following:
42+
43+
```sh
44+
composer test:standards
45+
```
46+
4147

4248
### Running unit tests
4349

4450
[PHPUnit](https://phpunit.de/) is included as a development dependency, and should be run regularly. When submitting changes, please be sure to add or update unit tests accordingly. You may run unit tests at any time by running:
4551

46-
```bash
47-
$ composer test
52+
```sh
53+
composer test:unit
4854
```
4955

5056
#### Code coverage
@@ -53,8 +59,8 @@ $ composer test
5359

5460
To generate a report of code coverage for the current branch, you may run the following Composer script, which will generate an HTML report in `tests/coverage/`:
5561

56-
```bash
57-
$ composer test-coverage
62+
```sh
63+
composer test:coverage
5864
```
5965

6066
Note that [both the Xdebug and tokenizer PHP extensions must be installed and active](https://phpunit.de/manual/current/en/textui.html) on the machine running the tests.

.github/workflows/coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
uses: ramsey/composer-install@v2
2121

2222
- name: Run test suite
23-
run: composer coding-standards
23+
run: composer test:standards

.github/workflows/static-code-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
run: composer test -- --version
2626

2727
- name: Run PHPStan
28-
run: composer static-analysis
28+
run: composer test:analysis

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
uses: ramsey/composer-install@v2
2727

2828
- name: Run test suite
29-
run: composer test
29+
run: composer test:unit

composer.json

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,33 @@
3737
}
3838
},
3939
"scripts": {
40-
"coding-standards": [
41-
"phpcs"
40+
"test": [
41+
"@test:all"
4242
],
43-
"static-analysis": [
44-
"phpstan analyse"
43+
"test:all": [
44+
"@test:unit",
45+
"@test:standards",
46+
"@test:analysis"
4547
],
46-
"test": [
47-
"simple-phpunit --testdox"
48+
"test:analysis": [
49+
"phpstan analyse"
4850
],
49-
"test-coverage": [
51+
"test:coverage": [
5052
"XDEBUG_MODE=coverage ./vendor/bin/simple-phpunit --coverage-html=tests/coverage --colors=always"
53+
],
54+
"test:standards": [
55+
"phpcs"
56+
],
57+
"test:unit": [
58+
"simple-phpunit --testdox"
5159
]
5260
},
5361
"scripts-descriptions": {
54-
"coding-standards": "Check coding standards.",
55-
"static-analysis": "Run static code analysis",
56-
"test": "Run all test suites.",
57-
"test-coverage": "Generate code coverage reports in tests/coverage."
62+
"test:all": "Run all automated tests",
63+
"test:analysis": "Run static code analysis",
64+
"test:coverage": "Generate code coverage reports in tests/coverage.",
65+
"test:standards": "Check coding standards.",
66+
"test:unit": "Run all test suites."
5867
},
5968
"config": {
6069
"preferred-install": "dist",

0 commit comments

Comments
 (0)