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

Commit f8ab915

Browse files
committed
Refactored makefile lint tasks
* One task to execute all ( and one ring to rule them all ) * One task to lint with PHP * One task to lint with PHP Code Sniffer using PSR2 standard * One task to lint with PHP Code Sniffer and Squiz rules about docblocks and other general checks. make lint make lint-php make lint-psr2 make lint-squiz
1 parent 6fc9cbf commit f8ab915

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
lint:
1+
lint: lint-php lint-psr2 lint-squiz
2+
3+
lint-php:
24
find src -name *.php -exec php -l {} \;
35
find test -name *.php -exec php -l {} \;
46
find spec -name *.php -exec php -l {} \;
57
find examples -name *.php -exec php -l {} \;
68

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
9+
lint-psr2:
10+
#./vendor/bin/phpcbf --standard=PSR2 src test examples
11+
./vendor/bin/phpcs --standard=PSR2 --colors -w -s --warning-severity=0 src test examples
12+
13+
lint-squiz:
14+
# ./vendor/bin/phpcbf --standard=Squiz,./ruleset.xml src test examples
15+
./vendor/bin/phpcs --standard=Squiz,./ruleset.xml --colors -w -s --warning-severity=0 src test examples
16+
1117

1218
test: tdd bdd
1319

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)