Skip to content

Commit f836e6f

Browse files
committed
Maintenance: phpstan, codesniffer, make
1 parent be507ae commit f836e6f

8 files changed

Lines changed: 112 additions & 36 deletions

File tree

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
indent_style = tab
11+
indent_size = tab
12+
tab_width = 4
13+
14+
[*.{json,yaml,yml,md}]
15+
indent_style = space
16+
indent_size = 2

.gitattributes

Lines changed: 10 additions & 0 deletions
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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
.idea
2-
.DS_Store
3-
vendor
4-
composer.lock
1+
# IDE
2+
/.idea
3+
4+
# Composer
5+
/vendor
6+
/composer.lock
7+
8+
# Tests
9+
/tests/tmp
10+
/coverage.*
11+
/tests/**/*.log
12+
/tests/**/*.html
13+
/tests/**/*.expected
14+
/tests/**/*.actual

Makefile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
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/ecs check src
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/ecs check src --fix
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 analyze -l 8 src
22+
vendor/bin/phpstan analyse -c phpstan.neon
23+
24+
.PHONY: tests
25+
tests:
26+
vendor/bin/tester -s -p php --colors 1 -C tests/Cases
27+
28+
.PHONY: coverage
29+
coverage:
30+
ifdef GITHUB_ACTION
31+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
32+
else
33+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases
34+
endif

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ For details on how to use this package, check out our [documentation](.docs).
3535

3636
## Version
3737

38-
| State | Version | Branch | Nette | PHP |
39-
|-------------|---------|----------|----------|----------|
40-
| stable | `^x.0` | `master` | `3.0+` | `>= 7.4` |
38+
| State | Version | Branch | Nette | PHP |
39+
|--------|---------|----------|--------|---------|
40+
| dev | `^0.3` | `master` | `3.2+` | `>=8.1` |
41+
| stable | `^0.2` | `master` | `3.2+` | `>=8.1` |
4142

4243
## Development
4344

@@ -49,6 +50,10 @@ This package is currently maintaining by these authors.
4950
<img width="80" height="80" src="https://avatars.githubusercontent.com/u/6872956?v=4">
5051
</a>
5152

53+
<a href="https://github.com/f3l1x">
54+
<img width="80" height="80" src="https://avatars2.githubusercontent.com/u/538058?v=3&s=80">
55+
</a>
56+
5257
-----
5358

5459
Consider to [support](https://contributte.org/partners.html) **contributte** development team.

ecs.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

phpstan.neon

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
includes:
2+
- vendor/contributte/phpstan/phpstan.neon
3+
4+
parameters:
5+
level: 9
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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
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"/>
5+
6+
<!-- Rules -->
7+
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
8+
<properties>
9+
<property name="rootNamespaces" type="array">
10+
<element key="src" value="Contributte\Vite"/>
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>
19+
20+
<!-- Excludes -->
21+
<exclude-pattern>/tests/tmp</exclude-pattern>
22+
</ruleset>

0 commit comments

Comments
 (0)