Skip to content

Commit 4da5b3c

Browse files
committed
Maintenance: codesniffer, phpstan, makefile
1 parent 29e6577 commit 4da5b3c

File tree

6 files changed

+77
-30
lines changed

6 files changed

+77
-30
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ indent_style = tab
1111
indent_size = tab
1212
tab_width = 4
1313

14-
[{*.json, *.yaml, *.yml, *.md}]
14+
[*.{json,yaml,yml,md}]
1515
indent_style = space
1616
indent_size = 2

.gitattributes

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.docs export-ignore
2+
.github export-ignore
3+
.editorconfig export-ignore
4+
.gitattributes export-ignore
5+
.gitignore export-ignore
6+
Makefile export-ignore
7+
README.md export-ignore
8+
phpstan.neon export-ignore
9+
ruleset.xml export-ignore
10+
tests export-ignore

.gitignore

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
/composer.lock
77

88
# Tests
9-
/tests/_output
10-
/tests/_support
11-
/coverage.xml
9+
/tests/tmp
10+
/coverage.*
11+
/tests/**/*.log
12+
/tests/**/*.html
13+
/tests/**/*.expected
14+
/tests/**/*.actual

Makefile

+25-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1-
.PHONY: install qa cs csf phpstan tests coverage-clover coverage-html
2-
1+
.PHONY: install
32
install:
43
composer update
54

5+
.PHONY: qa
66
qa: phpstan cs
77

8+
.PHONY: cs
89
cs:
9-
vendor/bin/linter src tests
10+
ifdef GITHUB_ACTION
11+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr
12+
else
13+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
14+
endif
1015

16+
.PHONY: csf
1117
csf:
12-
vendor/bin/codefixer src tests
18+
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
1319

20+
.PHONY: phpstan
1421
phpstan:
15-
vendor/bin/phpstan analyse -l 8 -c phpstan.neon src
22+
vendor/bin/phpstan analyse -c phpstan.neon
1623

24+
.PHONY: tests
1725
tests:
18-
vendor/bin/codecept run
26+
vendor/bin/codecept build
27+
vendor/bin/codecept run --debug
28+
29+
.PHONY: coverage
30+
coverage:
31+
ifdef GITHUB_ACTION
32+
vendor/bin/codecept build
33+
vendor/bin/codecept run --coverage-xml
34+
else
35+
vendor/bin/codecept build
36+
vendor/bin/codecept run --coverage-html
37+
endif

phpstan.neon

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
includes:
2-
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
3-
- vendor/phpstan/phpstan-nette/extension.neon
4-
- vendor/phpstan/phpstan-nette/rules.neon
5-
- vendor/phpstan/phpstan-strict-rules/rules.neon
2+
- vendor/contributte/phpstan/phpstan.neon
3+
64
parameters:
7-
excludePaths:
8-
- src/Latte/WizardMacros.php
5+
level: 8
6+
phpVersion: 80100
7+
8+
scanDirectories:
9+
- src
10+
11+
fileExtensions:
12+
- php
13+
14+
paths:
15+
- src
16+
- .docs
17+
18+
ignoreErrors:

ruleset.xml

+19-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<ruleset name="Contributte">
3-
<!-- Contributte Coding Standard -->
4-
<rule ref="./vendor/ninjify/coding-standard/contributte.xml"/>
2+
<ruleset name="Contributte" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
3+
<!-- Rulesets -->
4+
<rule ref="./vendor/contributte/qa/ruleset-8.0.xml"/>
55

6-
<!-- Specific rules -->
7-
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
8-
<properties>
9-
<property name="rootNamespaces" type="array" value="
10-
src=>Contributte\FormWizard
11-
"/>
12-
</properties>
13-
</rule>
6+
<!-- Rules -->
7+
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
8+
<properties>
9+
<property name="rootNamespaces" type="array">
10+
<element key="src" value="Contributte\FormWizard"/>
11+
<element key="tests" value="Tests"/>
12+
</property>
13+
<property name="extensions" type="array">
14+
<element key="php" value="php"/>
15+
<element key="phpt" value="phpt"/>
16+
</property>
17+
</properties>
18+
</rule>
1419

15-
<!-- Exclude folders -->
16-
<exclude-pattern>/tests/</exclude-pattern>
17-
</ruleset>
20+
<!-- Excludes -->
21+
<exclude-pattern>/tests/tmp</exclude-pattern>
22+
</ruleset>

0 commit comments

Comments
 (0)