2017 © Pedro Peláez
 

project phpqa

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

image

edmondscommerce/phpqa

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

  • Thursday, July 26, 2018
  • by edmondscommerce
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4,426 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 0 Forks
  • 8 Open issues
  • 27 Versions
  • 67 % Grown

The README.md

PHPQA

By Edmonds Commerce

Version 4 Updates

Brings in PHPStan 0.12 which is great, (*1)

However you will need to do the following:, (*2)

Remove PHPStan symlinks before upgrading

rm -f bin/phpstan*

Ensuring Correct PHPStan Configs

If you are overriding phpstan.neon in your qaConfig folder, then you need to make sure you have this in there:, (*3)

parameters:
    level: max
    inferPrivatePropertyTypeFromConstructor: true

Version 3 Updates

You should update your phpunit.xml file to use printerClass="\PHPUnit\Util\TestDox\CliTestDoxPrinter", (*4)

see ./phpunit.xml, (*5)

Introduction

PHPQA is a quality assurance pipeline written in BASH that can be run both on the desktop as part of your development process and then also as part of a continuous integration (CI) pipeline., (*6)

It runs tools in a logical order and will fail as quickly as possible., (*7)

PHPQA has only been tested on Linux., (*8)

Codacy Badge Build Status Code Coverage, (*9)

Installing

You can follow dev-master which should generally be pretty stable (all features are developed in feature branches and must pass CI before making it into master. Alternatively if you want real stability, you can track a release version of your choice., (*10)

composer require edmondscommerce/phpqa:dev-master@dev --dev

Your project's composer.json needs to specify a bin folder. If it's not already present, add this:, (*11)

    ...
    "config": {
        "bin-dir": "bin"
    }
    ...

Running

To run the full pipline, simply execute in your BASH terminal:, (*12)

./bin/qa 

Usage:

$ ./bin/qa -h

Usage:
bin/qa [-t tool to run ] [ -p path to scan ]

Defaults to using all tools and scanning whole project based on platform

 - use -h to see this help

 - use -p to specify a specific path to scan

 - use -t to specify a single tool:
     psr|psr4         psr4 validation
     com|composer     composer validation
     st|stricttypes   strict types validation
     lint|phplint     phplint
     stan|phpstan     phpstan
     unit|phpunit     phpunit
     infect|infection infection
     md|messdetector  php mess detector
     ma|markdown      markdown validation
     bf|phpbf         php beautifier and fixer
     cs|phpcs         php code sniffer
     l|loc            lines of code and other stats


By default, PHPQA will run against the entire project root., (*13)

Single Tool:

If you want to run a single tool, use the -t option. See the usage above to get the shortcuts for the tools, (*14)

./bin/qa -t stan

Specified Path:

Some of the tools allow us to restrict the scan to a specified path. To specify the path, use the -p option., (*15)

./bin/qa -p ./src/specified/path.php

Combined

You can combine both options, (*16)

./bin/qa -t stan -p ./src/specified/path.php

Configuration

Please see the Configuration docs, (*17)

The Pipeline

Please see the Pipeline docs, (*18)

The QA Tools

For full details and configuration instructions for all fo the tools, please see the PHPQA Tools, (*19)

Platform Detection

PHPQA comes with a set of generic tools and configs, but also has some inbuilt profiles., (*20)

Information on how this works can be found on the platform detection page, (*21)

Specific platforms' docs are at:, (*22)

Using for Continuous Integration (CI)

Please see the CI docs, (*23)

Git Hooks

Have a look in gitHooks for git hooks that can be used in your project, (*24)

The suggested way to use these is to symlink. Note that your actual git hook should not include the .bash file extension, (*25)

To use the pre-commit hook, for example, you would do:, (*26)

#cd to project root
cd /var/www/project/root

#cd to hooks folder
cd .git/hooks/

#create relative symlink
ln -s ../../vendor/edmondscommerce/phpqa/gitHooks/pre-commit.bash pre-commit

Then ensure the hook is executable by running it:, (*27)

``` bash, (*28)

cd to project root

cd /var/www/project/root, (*29)

./git/hooks/pre-commit, (*30)


And you should then see

===========================================, (*31)

PHPQA Pre Commit Hook

```, (*32)

The Versions

30/05 2018

dev-BetterBashArrayEmptyHandling

dev-BetterBashArrayEmptyHandling

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

  Sources   Download

MIT

The Requires

 

The Development Requires

30/05 2018

dev-PhpunitRetryFailedShouldTimeOut

dev-PhpunitRetryFailedShouldTimeOut

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

  Sources   Download

MIT

The Requires

 

The Development Requires

24/05 2018
09/05 2018
09/05 2018

dev-magento2-docs

dev-magento2-docs

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

  Sources   Download

MIT

The Requires

 

The Development Requires

09/05 2018

dev-magento2-merge-master

dev-magento2-merge-master

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

  Sources   Download

MIT

The Requires

 

The Development Requires

03/05 2018

dev-magento2

dev-magento2

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

  Sources   Download

MIT

The Requires

 

12/04 2018

dev-magento2-module

dev-magento2-module

Simple PHP QA pipeline and scripts. Largely just a collection of dependencies with configuration and scripts to run them together

  Sources   Download

MIT

The Requires

 

20/03 2018