Continuous integration/PHP CodeSniffer/fr

PHP CodeSniffer est un utilitaire pour détecter les erreurs de style de code dans le code PHP. Nous utilisons Composer comme conteneur pour gérer la version de CodeSniffer, les dépendances et l'exécution.

Tout d'abord, récupérez les dépendances du développement en utilisant.

For most MediaWiki extensions, skins and PHP libraries, executing  will also execute CodeSniffer. Due to the large size of MediaWiki core, it is exposed as a separate command,.



Execution locale sans Composer
Si vous rencontrez des problèmes avec les temporisations de Composer, vous pouvez l'exécuter directement avec. It's important to execute the version of PHP_CodeSniffer installed by Composer in your local project repository's vendor/bin so that all sniffs are found. Don't use the system version found on your PATH.

If you get out of memory errors, you can run it with more memory: .

Versions
It is recommended that you pin a specific version in your  file. We try to adhere to the spirit of semver.org, but not the actual standard. The main thing we are concerned about is ensuring that no matter what, if when you run, it will pass if it previously passed, and not randomly fail because a new version was released. The build randomly failing is a pain when you're trying to backport a patch or just trying to develop something and need to interrupt your work to fix it.

We are currently using 0 as our major version, and will bump the minor version for new sniffs, and bump the patch version for bug fixes or enhancements to existing sniffs. No stability is guaranteed for the actual PHP code included.



Voir aussi

 * - a skeleton extension, its  Continuous integration entry point runs PHP CodeSniffer
 * mediawiki-codesniffer - PHCS standard
 * Comment l'installer - Instructions on how to install CodeSniffer for an extension
 * https://phpcs.toolforge.org/
 * Comment l'installer - Instructions on how to install CodeSniffer for an extension
 * https://phpcs.toolforge.org/