Skip to content

Commit 985eaf7

Browse files
committed
Config: update to contributte/qa ruleset, add native type hints, fix code style
1 parent 3308bf8 commit 985eaf7

5 files changed

Lines changed: 28 additions & 14 deletions

File tree

.editorconfig

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Not archived
21
.docs export-ignore
3-
tests export-ignore
42
.editorconfig export-ignore
53
.gitattributes export-ignore
64
.gitignore export-ignore
75
.travis.yml export-ignore
8-
phpstan.neon export-ignore
6+
Makefile export-ignore
97
README.md export-ignore
8+
phpstan.neon export-ignore
109
ruleset.xml export-ignore
10+
tests export-ignore

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
/composer.lock
77

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

phpstan.neon

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +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
63

74
parameters:
85
level: 9
96
phpVersion: 80200
7+
8+
scanDirectories:
9+
- src
10+
11+
fileExtensions:
12+
- php
13+
1014
paths:
1115
- src
1216

17+
ignoreErrors:
18+
- identifier: trait.unused

ruleset.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010
<element key="src" value="Contributte\Nextras\Orm\QueryObject"/>
1111
<element key="tests" value="Tests"/>
1212
</property>
13+
<property name="extensions" type="array">
14+
<element value="php"/>
15+
<element value="phpt"/>
16+
</property>
1317
</properties>
1418
</rule>
1519

16-
<!-- Exclude rules not applicable to .phpt test cases (inline classes without namespaces) -->
20+
<!-- Exclude class naming rules for test files with inline helper classes -->
21+
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName">
22+
<exclude-pattern>/tests/Cases</exclude-pattern>
23+
</rule>
1724
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
1825
<exclude-pattern>/tests/Cases</exclude-pattern>
1926
</rule>
@@ -23,9 +30,6 @@
2330
<rule ref="Squiz.Classes.ClassFileName.NoMatch">
2431
<exclude-pattern>/tests/Cases</exclude-pattern>
2532
</rule>
26-
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName.NoMatchBetweenTypeNameAndFileName">
27-
<exclude-pattern>/tests/Cases</exclude-pattern>
28-
</rule>
2933

3034
<!-- Excludes -->
3135
<exclude-pattern>/tests/tmp</exclude-pattern>

0 commit comments

Comments
 (0)