Skip to content

Commit

Permalink
Composer: replace ninjify for contributte
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jun 10, 2023
1 parent 167a95b commit e19ef27
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 25 deletions.
23 changes: 12 additions & 11 deletions Makefile
@@ -1,4 +1,4 @@
.PHONY: install qa cs csf phpstan tests coverage-clover coverage-html
.PHONY: install qa cs csf phpstan tests coverage

install:
composer update
Expand All @@ -7,22 +7,23 @@ qa: phpstan cs

cs:
ifdef GITHUB_ACTION
vendor/bin/codesniffer -q --report=checkstyle src tests | cs2pr
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp -q --report=checkstyle src tests | cs2pr
else
vendor/bin/codesniffer src tests
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests
endif

csf:
vendor/bin/codefixer src tests
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests

phpstan:
vendor/bin/phpstan analyse -l max -c phpstan.neon src
vendor/bin/phpstan analyse -c phpstan.neon

tests:
vendor/bin/tester -s -p php --colors 1 -C tests/cases
vendor/bin/tester -s -p php --colors 1 -C tests/Cases

coverage-clover:
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases

coverage-html:
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.html --coverage-src ./src tests/cases
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
12 changes: 4 additions & 8 deletions composer.json
Expand Up @@ -22,12 +22,9 @@
"doctrine/cache": "^1.8.0"
},
"require-dev": {
"ninjify/nunjuck": "^0.4",
"ninjify/qa": "^0.12",
"phpstan/phpstan": "^0.12.0",
"phpstan/phpstan-deprecation-rules": "^0.12.0",
"phpstan/phpstan-nette": "^0.12.0",
"phpstan/phpstan-strict-rules": "^0.12.0"
"contributte/qa": "^0.4",
"contributte/tester": "^0.3",
"contributte/phpstan": "^0.1"
},
"autoload": {
"psr-4": {
Expand All @@ -36,8 +33,7 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\Cases\\": "tests/cases",
"Tests\\Toolkit\\": "tests/toolkit"
"Tests\\": "tests"
}
},
"minimum-stability": "dev",
Expand Down
33 changes: 33 additions & 0 deletions phpstan.neon
@@ -0,0 +1,33 @@
includes:
- vendor/contributte/phpstan/phpstan.neon

parameters:
level: 9
phpVersion: 80100

scanDirectories:
- src

fileExtensions:
- php

paths:
- src
- .docs

ignoreErrors:
-
message: """
#^Fetching class constant class of deprecated class Doctrine\\\\Common\\\\Cache\\\\ApcuCache\\:
Deprecated without replacement in doctrine/cache 1\\.11\\. This class will be dropped in 2\\.0$#
"""
count: 1
path: src/DI/CacheExtension.php

-
message: """
#^Fetching class constant class of deprecated class Doctrine\\\\Common\\\\Cache\\\\PhpFileCache\\:
Deprecated without replacement in doctrine/cache 1\\.11\\. This class will be dropped in 2\\.0$#
"""
count: 1
path: src/DI/CacheExtension.php
15 changes: 9 additions & 6 deletions ruleset.xml
@@ -1,15 +1,18 @@
<?xml version="1.0"?>
<ruleset>
<!-- Contributte Coding Standard -->
<rule ref="./vendor/ninjify/coding-standard/contributte.xml"/>
<?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="Nettrine\Cache"/>
<element key="tests/cases" value="Tests\Cases"/>
<element key="tests/toolkit" value="Tests\Toolkit"/>
<element key="tests" value="Tests"/>
</property>
</properties>
</rule>

<!-- Excludes -->
<exclude-pattern>/tests/tmp</exclude-pattern>
</ruleset>

0 comments on commit e19ef27

Please sign in to comment.