Add code style & linting rules for PHP
This is based on Mediawiki boilerplate composer.json & phpcs.xml. This adds a Makefile too. To setup: $ make install-dev $ make lint $ make cs
This commit is contained in:
Родитель
a03ebd7c33
Коммит
1852110938
|
@ -0,0 +1,21 @@
|
|||
|
||||
|
||||
install-dev:
|
||||
composer install
|
||||
|
||||
test: lint cs
|
||||
|
||||
lint: phplint
|
||||
|
||||
cs: phpcs
|
||||
|
||||
phplint:
|
||||
./vendor/bin/parallel-lint --exclude vendor/ .
|
||||
|
||||
phpcs:
|
||||
./vendor/bin/phpcs -p --colors .
|
||||
|
||||
phpcsfix:
|
||||
./vendor/bin/phpcbf .
|
||||
|
||||
.PHONY: test lint cs phpcs phplint phpcsfix
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"require-dev": {
|
||||
"jakub-onderka/php-parallel-lint": "0.9.2",
|
||||
"mediawiki/mediawiki-codesniffer": "0.7.2"
|
||||
},
|
||||
"scripts": {
|
||||
"fix": "phpcbf",
|
||||
"test": [
|
||||
"parallel-lint . --exclude vendor",
|
||||
"phpcs -p -s"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php,php5,inc"/>
|
||||
<arg name="encoding" value="utf8"/>
|
||||
<exclude-pattern>vendor/</exclude-pattern>
|
||||
<exclude-pattern>pchart/</exclude-pattern>
|
||||
</ruleset>
|
Загрузка…
Ссылка в новой задаче