Skip to content

Commit 6ca712f

Browse files
committed
PHPCodeSniffer config updated, some Composer related scripts created & README.md updated (#103)
1 parent 250394f commit 6ca712f

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

README.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -342,26 +342,44 @@ To run tests, write the following command in your command line inside the main D
342342
vendor/bin/phpunit tests/
343343
```
344344

345+
or use a Composer script
346+
347+
```bash
348+
composer test
349+
```
350+
345351
### Code style tests
346352

347353
This code follows [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/) standards.
348354

349-
To run tests for code style write the following command in your command line inside the main DataCoder project directory
355+
To run tests for code style write the following command in your command line inside the main DataCoder project directory
350356

351357
```bash
352358
vendor/bin/phpcs tests/ src/
353359
```
354360

361+
or use a Composer script
362+
363+
```bash
364+
composer sniff
365+
```
366+
367+
You can also use a Composer script for running both tests and check code style
368+
369+
```bash
370+
composer check
371+
```
372+
355373
## Built with
356374

357375
* [Linux Mint](https://www.linuxmint.com/)
358376
* [Eclipse](https://eclipse.org/)
359377
* [Remarkable](https://remarkableapp.github.io/)
360378
* [PHPUnit](https://phpunit.de/)
361-
* [PHPCodeSniffer](https://www.squizlabs.com/php-codesniffer)
379+
* [PHPCodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
362380
* [Git](https://git-scm.com/)
363381
* [GitHub](https://github.com/)
364-
* [Travis](https://travis-ci.org/)
382+
* [Travis](https://travis-ci.com/)
365383

366384
## Versioning
367385

composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,10 @@
6262
"tests/unit_tests/file/"
6363
]
6464
}
65-
}
65+
},
66+
"scripts": {
67+
"test": "vendor/bin/phpunit ./tests",
68+
"sniff": "vendor/bin/phpcs ./src ./tests",
69+
"check": "composer test; composer sniff"
70+
}
6671
}

phpcs.xml

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
<?xml version="1.0"?>
2-
<ruleset name="PHP_CodeSniffer">
3-
<description>The coding standard for PHP_CodeSniffer itself.</description>
2+
<ruleset name="Exorg_PHP_DataCoder">
3+
<description>The coding standard for PHPDataCoder.</description>
44

5-
<exclude-pattern>tests/testing_environment/data/*</exclude-pattern>
6-
<exclude-pattern>tests/testing_environment/files/*</exclude-pattern>
7-
<exclude-pattern>src/data_format/DataFormat.php</exclude-pattern>
5+
<file>./src</file>
6+
<file>./tests</file>
7+
8+
<exclude-pattern>./tests/testing_environment/data/*</exclude-pattern>
9+
<exclude-pattern>./tests/testing_environment/files/*</exclude-pattern>
10+
<exclude-pattern>./src/data_format/DataFormat.php</exclude-pattern>
811

912
<arg name="report" value="full"/>
1013
<arg value="np"/>

0 commit comments

Comments
 (0)