Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 1.62 KB

File metadata and controls

35 lines (21 loc) · 1.62 KB

Linting and Static Analysis

This document outlines the tools and procedures for linting and static analysis in this project.

PHPCS for checking coding standards

We check against the following standards/rulesets:

The .phpcs.xml.dist file contains a suggested configuration, but you are free to amend this. You can also extend it for more granularity of configuration for theme and custom plugins.

To run PHPCS, navigate to the directory where the relevant .phpcs.xml.dist lives, and type:

vendor/bin/phpcs

See the PHPCS documentation (or run phpcs -h) for the available command line arguments.

PHPStan for static analysis

We use PHPStan for static analysis to find potential bugs and improve code quality. It's configured in the phpstan.neon file.

To run PHPStan locally, use the following command:

composer analyze

This will run PHPStan with the configuration defined in phpstan.neon. The command is an alias for vendor/bin/phpstan analyse --memory-limit=1024M.

PHPStan is also part of our CI pipeline and runs automatically on every pull request.