programic/pro-code-quality

Programic Quality Control package

dev-main 2022-02-15 18:32 UTC

This package is auto-updated.

Last update: 2024-11-16 00:12:45 UTC


README

Composer package that includes all the packages required by the Definition of Done for Code Quality.

  • PHPMD: PHP Mess Detector
  • PHPStan: PHP Static Analysis
  • PHPMND: PHP Magic Number Detection
  • PHPCPD: PHP Copy & Paste Detection
  • ECS: Easy Coding Standards
    • includes PHP_CodeSniffer and PHP-CS-Fixer
    • Additional rules:
      • symplify/coding-standard
      • slevomat/coding-standard

How to add to your project

  1. Add remote repository:

    $ composer config --append repositories.pro-qa vcs git@bitbucket.org:programic/pro-quality-control.git
  2. Make sure the minimum-stability is set to dev:

    $ composer config minimum-stability dev
  3. Require the package:

    $ composer require --dev programic/quality-control
  4. Copy the example config files for each tool to your project:

    Adjust the rules as needed.

  5. Add the scripts to your composer.json (see example in composer.example.json).

How to run the code quality checks

Run all the checks

$ composer check

Run a specific check:

$ composer check:ecs
$ composer check:phpmd
$ composer check:phpmnd
$ composer check:phpcpd
$ composer check:phpstan