mirror of
https://github.com/wiosna-dev/common-library.git
synced 2026-03-12 09:31:51 +01:00
composer > squizlabs/php_codesniffer package > use ^3.4 (instead of ^2.9)
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -43,6 +43,13 @@
|
|||||||
/.php_cs.cache
|
/.php_cs.cache
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
### PHP_CodeSniffer
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
/.phpcs-cache
|
||||||
|
/phpcs.xml
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
### Build files
|
### Build files
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
@@ -117,6 +124,7 @@ Temporary Items
|
|||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
# Windows thumbnail cache files
|
# Windows thumbnail cache files
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
Thumbs.db:encryptable
|
||||||
ehthumbs.db
|
ehthumbs.db
|
||||||
ehthumbs_vista.db
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
"phpstan/phpstan": "^0.11.1",
|
"phpstan/phpstan": "^0.11.1",
|
||||||
"phpunit/phpunit": "^8.0",
|
"phpunit/phpunit": "^8.0",
|
||||||
"sebastian/phpcpd": "^4.1",
|
"sebastian/phpcpd": "^4.1",
|
||||||
"squizlabs/php_codesniffer": " ^2.9",
|
"squizlabs/php_codesniffer": "^3.4",
|
||||||
"vimeo/psalm": "^3.0"
|
"vimeo/psalm": "^3.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|||||||
@@ -105,13 +105,6 @@ docker-compose exec php phing -f phing/tests.xml test:phpunit
|
|||||||
docker-compose run --rm phpunit --verbose --no-coverage
|
docker-compose run --rm phpunit --verbose --no-coverage
|
||||||
```
|
```
|
||||||
|
|
||||||
# Versions of packages
|
|
||||||
|
|
||||||
### squizlabs/php_codesniffer
|
|
||||||
|
|
||||||
I have to use [squizlabs/php_codesniffer](https://packagist.org/packages/squizlabs/php_codesniffer) `^2.9` instead of
|
|
||||||
`^3.3`, because [Phing doesn't support 3.x PHP_CodeSniffer](https://github.com/phingofficial/phing/issues/716).
|
|
||||||
|
|
||||||
# Mutation Tests
|
# Mutation Tests
|
||||||
|
|
||||||
Served by [Infection — Mutation Testing Framework](https://infection.github.io).
|
Served by [Infection — Mutation Testing Framework](https://infection.github.io).
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ dir.tests = ${project.basedir}/tests
|
|||||||
dir.build = ${project.basedir}/build
|
dir.build = ${project.basedir}/build
|
||||||
dir.reports = ${dir.build}/reports
|
dir.reports = ${dir.build}/reports
|
||||||
dir.reports.coverage = ${dir.reports}/phpunit-coverage
|
dir.reports.coverage = ${dir.reports}/phpunit-coverage
|
||||||
|
dir.reports.code_sniffer = ${dir.reports}/code_sniffer
|
||||||
|
|
||||||
# Data directories
|
# Data directories
|
||||||
#
|
#
|
||||||
@@ -72,6 +73,10 @@ check.php_coveralls.command = ./vendor/bin/php-coveralls --ansi -v
|
|||||||
#
|
#
|
||||||
tests.cs_fixer.command = ./vendor/bin/php-cs-fixer fix --verbose
|
tests.cs_fixer.command = ./vendor/bin/php-cs-fixer fix --verbose
|
||||||
|
|
||||||
|
# Path of the PHP_CodeSniffer (https://github.com/squizlabs/PHP_CodeSniffer)
|
||||||
|
#
|
||||||
|
tests.code_sniffer.command = ./vendor/bin/phpcs --report-full=${dir.reports.code_sniffer}/full.txt --report-summary=${dir.reports.code_sniffer}/summary.txt --report-checkstyle=${dir.reports.code_sniffer}/checkstyle.xml
|
||||||
|
|
||||||
# Test database path
|
# Test database path
|
||||||
#
|
#
|
||||||
tests.database = ${dir.data.temporary}/database.sqlite
|
tests.database = ${dir.data.temporary}/database.sqlite
|
||||||
|
|||||||
@@ -55,14 +55,9 @@
|
|||||||
test:infection"
|
test:infection"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Symfony2 code sniffer -->
|
<!-- PHP_CodeSniffer -->
|
||||||
<target name="check:cs" depends="build:prepare">
|
<target name="check:cs" depends="build:prepare">
|
||||||
<phpcodesniffer standard="PSR2" showWarnings="true">
|
<exec command="${tests.code_sniffer.command}" passthru="true"/>
|
||||||
<fileset refid="sourcecode"/>
|
|
||||||
<formatter type="checkstyle" outfile="${dir.reports}/checkstyle.xml"/>
|
|
||||||
<formatter type="csv" outfile="${dir.reports}/checkstyle.csv"/>
|
|
||||||
<formatter type="summary" outfile="${dir.reports}/checkstyle-summary.txt"/>
|
|
||||||
</phpcodesniffer>
|
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- copy/paste detector -->
|
<!-- copy/paste detector -->
|
||||||
@@ -112,6 +107,7 @@
|
|||||||
<target name="build:prepare" depends="build:clean">
|
<target name="build:prepare" depends="build:clean">
|
||||||
<mkdir dir="${dir.reports}"/>
|
<mkdir dir="${dir.reports}"/>
|
||||||
<mkdir dir="${dir.reports.coverage}"/>
|
<mkdir dir="${dir.reports.coverage}"/>
|
||||||
|
<mkdir dir="${dir.reports.code_sniffer}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<!-- Checkout and finalization -->
|
<!-- Checkout and finalization -->
|
||||||
|
|||||||
16
phpcs.xml.dist
Normal file
16
phpcs.xml.dist
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
|
||||||
|
|
||||||
|
<arg name="basepath" value="."/>
|
||||||
|
<arg name="cache" value=".phpcs-cache"/>
|
||||||
|
<arg name="colors"/>
|
||||||
|
<arg name="extensions" value="php"/>
|
||||||
|
|
||||||
|
<rule ref="PSR2"/>
|
||||||
|
|
||||||
|
<file>src/</file>
|
||||||
|
<file>tests/</file>
|
||||||
|
|
||||||
|
</ruleset>
|
||||||
Reference in New Issue
Block a user