Skip to content

Commit

Permalink
Maintenance: git, codesniffer, phpstan, makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Dec 13, 2023
1 parent 4e1b19f commit 9c2ecb8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -11,6 +11,6 @@ indent_style = tab
indent_size = tab
tab_width = 4

[{*.json,*.yml,*.yaml,*.md}]
[*.{json,yaml,yml,md}]
indent_style = space
indent_size = 2
7 changes: 3 additions & 4 deletions .gitattributes
@@ -1,11 +1,10 @@
# Not archived
.docs export-ignore
tests export-ignore
.github export-ignore
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
Makefile export-ignore
phpstan.neon export-ignore
README.md export-ignore
phpstan.neon export-ignore
ruleset.xml export-ignore
tests export-ignore
7 changes: 6 additions & 1 deletion .gitignore
Expand Up @@ -6,4 +6,9 @@
/composer.lock

# Tests
/coverage.xml
/tests/tmp
/coverage.*
/tests/**/*.log
/tests/**/*.html
/tests/**/*.expected
/tests/**/*.actual
11 changes: 8 additions & 3 deletions Makefile
@@ -1,26 +1,31 @@
.PHONY: install qa cs csf phpstan tests coverage

.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 --colors -nsp src tests
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
Expand Down
10 changes: 4 additions & 6 deletions phpstan.neon
@@ -1,12 +1,9 @@
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon
# - vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/contributte/phpstan/phpstan.neon

parameters:
level: 8
phpVersion: 80000
level: 9
phpVersion: 80100

scanDirectories:
- src
Expand All @@ -16,5 +13,6 @@ parameters:

paths:
- src
- .docs

ignoreErrors:
8 changes: 2 additions & 6 deletions ruleset.xml
@@ -1,11 +1,7 @@
<?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"
>
<ruleset name="Contributte" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<!-- Rulesets -->
<rule ref="./vendor/ninjify/coding-standard/contributte.xml"/>
<rule ref="./vendor/contributte/qa/ruleset-8.0.xml"/>

<!-- Rules -->
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
Expand Down

0 comments on commit 9c2ecb8

Please sign in to comment.