mediawiki / mediawiki-codesniffer
MediaWiki CodeSniffer Standards
Installs: 628 913
Dependents: 181
Suggesters: 0
Security: 0
Stars: 28
Watchers: 12
Forks: 10
Type:phpcodesniffer-standard
Requires
- php: >=7.2.0
- ext-mbstring: *
- composer/semver: ^1.5.2|^3.0.1
- composer/spdx-licenses: ~1.5.2
- squizlabs/php_codesniffer: 3.5.8
Requires (Dev)
- mediawiki/mediawiki-phan-config: 0.10.4
- mediawiki/minus-x: 1.1.0
- php-parallel-lint/php-console-highlighter: 0.5.0
- php-parallel-lint/php-parallel-lint: 1.2.0
- phpunit/phpunit: ^8.5
- dev-master
- v34.0.0
- v33.0.0
- v32.0.0
- v31.0.0
- v30.0.0
- v29.0.0
- v28.0.0
- v27.0.0
- v26.0.0
- 25.0.0
- v24.0.0
- v23.0.0
- v22.0.0
- v21.0.0
- v20.0.0
- 19.x-dev
- 19.4.0
- 19.3.0
- v19.2.0
- 19.1.0
- v19.0.0
- v18.0.0
- v17.0.0
- v16.0.1
- v16.0.0
- v15.0.0
- v14.1.0
- v14.0.0
- v13.0.0
- v0.12.0
- v0.11.1
- v0.11.0
- v0.10.1
- v0.10.0
- v0.9.0
- 0.8.x-dev
- v0.8.1
- v0.8.0
- v0.8.0-alpha.1
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.1
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.0
- 0.1.0
This package is auto-updated.
Last update: 2021-01-19 23:56:27 UTC
README
Abstract
This project implements a set of rules for use with PHP CodeSniffer.
See MediaWiki conventions on our wiki for a detailed description of the coding conventions that are validated by these rules. :-)
How to install
-
Create a composer.json which adds this project as a dependency:
{ "require-dev": { "mediawiki/mediawiki-codesniffer": "34.0.0" }, "scripts": { "test": [ "phpcs -p -s" ], "fix": "phpcbf" } }
-
Create a .phpcs.xml with our configuration:
<?xml version="1.0"?> <ruleset> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/> <file>.</file> <arg name="bootstrap" value="./vendor/mediawiki/mediawiki-codesniffer/utils/bootstrap-ci.php"/> <arg name="extensions" value="php,php5,inc"/> <arg name="encoding" value="UTF-8"/> </ruleset>
-
Install:
composer update
-
Run:
composer test
-
Run:
composer fix
to auto-fix some of the errors, others might need manual intervention. -
Commit!
Note that for most MediaWiki projects, we'd also recommend adding a PHP linter
to your composer.json
– see the full documentation for more details.
TODO
- Migrate the old code-utils/check-vars.php