Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maintenance: git, codesniffer, phpstan, makefile
- Loading branch information
Showing
6 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
indent_size = tab | ||
tab_width = 4 | ||
|
||
[*.{json,yaml,yml,md}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.docs export-ignore | ||
.github export-ignore | ||
.editorconfig export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
Makefile export-ignore | ||
README.md export-ignore | ||
phpstan.neon export-ignore | ||
ruleset.xml export-ignore | ||
tests export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# IDE | ||
/.idea | ||
|
||
# Composer | ||
/vendor | ||
/composer.lock | ||
|
||
# Tests | ||
/tests/tmp | ||
/coverage.* | ||
/tests/**/*.log | ||
/tests/**/*.html | ||
/tests/**/*.expected | ||
/tests/**/*.actual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.PHONY: install | ||
install: | ||
composer update | ||
|
||
.PHONY: qa | ||
qa: phpstan cs | ||
|
||
.PHONY: cs | ||
cs: | ||
ifdef GITHUB_ACTION | ||
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr | ||
else | ||
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests | ||
endif | ||
|
||
.PHONY: csf | ||
csf: | ||
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests | ||
|
||
.PHONY: phpstan | ||
phpstan: | ||
vendor/bin/phpstan analyse -c phpstan.neon | ||
|
||
.PHONY: tests | ||
tests: | ||
vendor/bin/tester -s -p php --colors 1 -C tests/Cases | ||
|
||
.PHONY: coverage | ||
coverage: | ||
ifdef GITHUB_ACTION | ||
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases | ||
else | ||
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
includes: | ||
- vendor/contributte/phpstan/phpstan.neon | ||
|
||
parameters: | ||
level: 9 | ||
phpVersion: 80100 | ||
|
||
scanDirectories: | ||
- src | ||
|
||
fileExtensions: | ||
- php | ||
|
||
paths: | ||
- src | ||
- .docs | ||
|
||
ignoreErrors: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ruleset name="Contributte" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"> | ||
<!-- Rulesets --> | ||
<rule ref="./vendor/contributte/qa/ruleset-8.0.xml"/> | ||
|
||
<!-- Rules --> | ||
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"> | ||
<properties> | ||
<property name="rootNamespaces" type="array"> | ||
<element key="src" value="Contributte\Elasticsearch"/> | ||
<element key="tests" value="Tests"/> | ||
</property> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Excludes --> | ||
<exclude-pattern>/tests/tmp</exclude-pattern> | ||
</ruleset> |