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

Commit 9bc00cf

Browse files
authored
Merge 51d0330 into 937fed4
2 parents 937fed4 + 51d0330 commit 9bc00cf

File tree

4 files changed

+340
-84
lines changed

4 files changed

+340
-84
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ git:
1010

1111
before_script:
1212
- composer install
13-
1413
jobs:
1514
include:
1615
- stage: ParallelLint
17-
script: composer lint
16+
script: composer phing lint
1817
- stage: CodeSniffer
19-
script: composer phpcs
18+
script: composer phing phpcs
2019
- stage: PHPStan
21-
script: composer phpstan
20+
script: composer phing phpstan
2221
- stage: Test
2322
install:
2423
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
2524
script:
26-
- composer test
25+
- composer phing test
2726
- php php-coveralls.phar --verbose --config php/tests/.coveralls.yml
2827
cache:
2928
directories:

build.xml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project name="Wavevision Point" default="init">
3+
4+
5+
<property name="src" value="php/WavevisionCodingStandard"/>
6+
<property name="tests" value="php/tests"/>
7+
<property name="phpBin" value="php"/>
8+
<property name="codeSnifferExclude" value="*/data/*"/>
9+
<property name="codeSnifferRuleset" value="codesniffer-ruleset.xml"/>
10+
<property name="bin" value="vendor/bin"/>
11+
12+
<target name="check" description="Run lints and tests. Run before every pull request"
13+
depends="rm-cache, lint, cs, phpstan, test"/>
14+
<target name="cs" description="Check code style and fix it if possible" depends="phpcbf, phpcs"/>
15+
<target name="init" description="Initialize project" depends="composer"/>
16+
17+
<target name="rm-cache" description="Clear cache">
18+
<exec executable="rm -rf temp/cache"/>
19+
</target>
20+
21+
<target name="composer" description="Download php dependencies">
22+
<exec
23+
executable="composer"
24+
logoutput="true"
25+
passthru="true"
26+
checkreturn="true"
27+
>
28+
<arg value="install"/>
29+
</exec>
30+
</target>
31+
32+
<target name="lint" description="Check php syntax">
33+
<exec
34+
executable="${bin}/parallel-lint"
35+
logoutput="true"
36+
passthru="true"
37+
checkreturn="true"
38+
>
39+
<arg value="-e"/>
40+
<arg value="${phpBin}"/>
41+
<arg value="${src}"/>
42+
<arg value="${tests}"/>
43+
</exec>
44+
</target>
45+
46+
<target name="phpcbf" description="Fix fixable code style issues">
47+
<exec
48+
executable="${bin}/phpcbf"
49+
logoutput="true"
50+
passthru="true"
51+
checkreturn="false"
52+
>
53+
<arg value="-spn"/>
54+
<arg value="--standard=${codeSnifferRuleset}"/>
55+
<arg value="--extensions=${phpBin}"/>
56+
<arg value="--ignore=${codeSnifferExclude}"/>
57+
<arg value="${src}"/>
58+
<arg value="${tests}"/>
59+
</exec>
60+
</target>
61+
62+
<target name="phpcs" description="Check code style and don't fix it">
63+
<exec
64+
executable="${bin}/phpcs"
65+
logoutput="true"
66+
passthru="true"
67+
checkreturn="true"
68+
>
69+
<arg value="-sp"/>
70+
<arg value="--standard=${codeSnifferRuleset}"/>
71+
<arg value="--extensions=${phpBin}"/>
72+
<arg value="--ignore=${codeSnifferExclude}"/>
73+
<arg value="${src}"/>
74+
<arg value="${tests}"/>
75+
</exec>
76+
</target>
77+
78+
<target name="phpstan" description="Run static analysis">
79+
<exec
80+
executable="${bin}/phpstan"
81+
logoutput="true"
82+
passthru="true"
83+
checkreturn="true"
84+
>
85+
<arg value="analyze"/>
86+
<arg value="${src}"/>
87+
<arg value="--level"/>
88+
<arg value="max"/>
89+
</exec>
90+
</target>
91+
92+
<target name="test" description="Run tests">
93+
<exec
94+
executable="${bin}/phpunit"
95+
logoutput="true"
96+
passthru="true"
97+
checkreturn="true"
98+
>
99+
</exec>
100+
</target>
101+
102+
<target name="test-no-coverage" description="Run tests without coverage">
103+
<exec
104+
executable="${bin}/phpunit"
105+
logoutput="true"
106+
passthru="true"
107+
checkreturn="true"
108+
>
109+
<arg value="--no-coverage"/>
110+
</exec>
111+
</target>
112+
113+
114+
</project>

composer.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
}
1919
],
2020
"homepage": "https://github.com/wavevision/coding-standard",
21+
"config": {
22+
"bin-dir": "vendor/bin"
23+
},
2124
"require": {
2225
"php": ">=7.2",
2326
"slevomat/coding-standard": "^5.0"
@@ -30,25 +33,15 @@
3033
"require-dev": {
3134
"phpunit/phpunit": "^8.3",
3235
"jakub-onderka/php-parallel-lint": "^1.0",
33-
"phpstan/phpstan": "^0.10"
36+
"phpstan/phpstan": "^0.10",
37+
"phing/phing": "^2.16"
3438
},
3539
"suggest": {
3640
"phpstan/phpstan": "PHP Static Analysis Tool - discover bugs in your code without running it!",
3741
"sebastianbergmann/phpunit": "The PHP Unit Testing framework.",
3842
"jakub-onderka/php-parallel-lint": "This tool check syntax of PHP files faster than serial check with fancier output."
3943
},
4044
"scripts": {
41-
"lint": "vendor/bin/parallel-lint -e php php ",
42-
"phpcs": "vendor/bin/phpcs -sp --standard=codesniffer-ruleset.xml --extensions=php php --ignore=*/data/*",
43-
"phpcbf": "vendor/bin/phpcbf -spn --standard=codesniffer-ruleset.xml --extensions=php php --ignore=*/data/*",
44-
"cs": "composer phpcbf ; composer phpcs",
45-
"phpstan": "vendor/bin/phpstan analyse php --level max",
46-
"test": "./vendor/bin/phpunit",
47-
"fix": [
48-
"@lint",
49-
"@cs",
50-
"@phpstan",
51-
"@test"
52-
]
45+
"phing": "phing"
5346
}
5447
}

0 commit comments

Comments
 (0)