Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit dc3ba75

Browse files
authored
Merge pull request repejota#94 from repejota/feature/phpcs
Feature/phpcs
2 parents 6fc9cbf + af6d647 commit dc3ba75

3 files changed

Lines changed: 30 additions & 10 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ before_script:
1717
- make deps
1818
script:
1919
- mkdir -p build/logs
20+
- make lint-php
2021
- make test
2122
after_script:
2223
- php vendor/bin/coveralls

Makefile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
1-
lint:
1+
lint: lint-php lint-psr2 lint-squiz
2+
3+
.PHONY: lint-php
4+
lint-php:
25
find src -name *.php -exec php -l {} \;
36
find test -name *.php -exec php -l {} \;
47
find spec -name *.php -exec php -l {} \;
58
find examples -name *.php -exec php -l {} \;
69

7-
cs: lint
8-
./vendor/bin/phpcbf --standard=PSR2 src test examples
9-
./vendor/bin/phpcs --standard=PSR2 --warning-severity=0 src test examples
10-
./vendor/bin/phpcs --standard=Squiz --sniffs=Squiz.Commenting.FunctionComment,Squiz.Commenting.FunctionCommentThrowTag,Squiz.Commenting.ClassComment,Squiz.Commenting.VariableComment src test examples
10+
.PHONY: lint-psr2
11+
lint-psr2:
12+
#./vendor/bin/phpcbf --standard=PSR2 src test examples
13+
./vendor/bin/phpcs --standard=PSR2 --colors -w -s --warning-severity=0 src test examples
14+
15+
.PHONY: lint-squiz
16+
lint-squiz:
17+
# ./vendor/bin/phpcbf --standard=Squiz,./ruleset.xml src test examples
18+
./vendor/bin/phpcs --standard=Squiz,./ruleset.xml --colors -w -s --warning-severity=0 src test examples
1119

12-
test: tdd bdd
1320

14-
tdd:
21+
test: test-tdd test-bdd
22+
23+
.PHONY: test-tdd
24+
test-tdd:
1525
./vendor/bin/phpunit test
1626

17-
bdd:
27+
.PHONY: test-bdd
28+
test-bdd:
1829
./vendor/bin/phpspec run --format=pretty -v
1930

2031
cover:
@@ -43,5 +54,3 @@ phpdoc:
4354

4455
serve-phpdoc:
4556
cd docs/api && php -S localhost:8000 && cd ../..
46-
47-
.PHONY: lint test cs cover deps dist-clean

ruleset.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Custom Standard">
3+
<description>php-nats Coding Standards for Inline Documentation and Comments</description>
4+
5+
<rule ref="Squiz.Commenting">
6+
<!-- It is too early for PHP7 features to be required -->
7+
<exclude name="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing" />
8+
</rule>
9+
10+
</ruleset>

0 commit comments

Comments
 (0)