Download the PHP package javihgil/composer-ci-tools without Composer
On this page you can find all versions of the php package javihgil/composer-ci-tools. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download javihgil/composer-ci-tools
More information about javihgil/composer-ci-tools
Files in javihgil/composer-ci-tools
Package composer-ci-tools
Short Description Library to integrate some testing and developing tools into composer scripts
License MIT
Informations about the package composer-ci-tools
Composer CI Tools
This library provides a easy way to integrate some common developing and testing tasks in the middle of composer workflow.
The advantage of include your CI scripts into composer configuration is to use a unique tool (that is also installed) that integrates the development and testing logic.
Configure
$ composer require javihgil/composer-ci-tools:~1.0 --dev
Usage
This is an example composer.json:
{
"extra": {
"ci-tools": {
"global": {
"log-format": " <fg=cyan>> %s</>"
},
"phpunit": {
"report-config": "phpunit-reports.xml"
},
"git": {
"commit-msg-regex": "/^[a-z\\s\\-0-9\\.]{20,}$/i",
"commit-msg-error": "The commit message must be at least 20 characters long"
},
"phpcs" : {
"standard": "PSR2",
}
}
},
"scripts": {
"post-install-cmd": [
"Jhg\\ComposerCiTools\\GitHooksInstaller::preCommit",
"Jhg\\ComposerCiTools\\GitHooksInstaller::commitMsg"
],
"pre-commit-hook": [
"Jhg\\ComposerCiTools\\Lint::php",
"Jhg\\ComposerCiTools\\PhpUnit::test"
],
"commit-msg-hook": [
"Jhg\\ComposerCiTools\\Git::commitMsgRegex"
],
"test": [
"@composer validate",
"Jhg\\ComposerCiTools\\PhpCsFixer::fix",
"Jhg\\ComposerCiTools\\Lint::phpLazy",
"Jhg\\ComposerCiTools\\PhpUnit::test",
"Jhg\\ComposerCiTools\\SecurityChecker::check"
],
"report": [
"@composer install",
"Jhg\\ComposerCiTools\\PhpUnit::report"
"Jhg\\ComposerCiTools\\PhpCs::report"
]
}
}
This composer.json provides a test and a report task. These can be executed with:
$ composer test
./composer.json is valid
> Jhg\ComposerCiTools\Lint::php
> No syntax errors detected in ./src/Script/Lint.php
> No syntax errors detected in ./src/Script/SecurityChecker.php
> No syntax errors detected in ./src/Script/Gulp.php
> No syntax errors detected in ./src/Script/AbstractScriptHandler.php
> No syntax errors detected in ./src/Script/Write.php
> No syntax errors detected in ./src/Script/GitHooksInstaller.php
> No syntax errors detected in ./src/Script/PhpCpd.php
> No syntax errors detected in ./src/Script/PhpCsFixer.php
> No syntax errors detected in ./src/Script/PhpUnit.php
> No syntax errors detected in ./src/Script/PhpCs.php
> Jhg\ComposerCiTools\PhpUnit::test
> PHPUnit 4.8.24 by Sebastian Bergmann and contributors.
> Time: 41 ms, Memory: 4.50Mb
> No tests executed!
$ composer report
> Jhg\ComposerCiTools\PhpUnit::report
> PHPUnit 4.8.24 by Sebastian Bergmann and contributors.
> Time: 850 ms, Memory: 7.00Mb
>
> No tests executed!
> Generating code coverage report in HTML format ...
> done
Also uses a preCommit GIT hook, that is configured after install command execution. Every pre-commit Hook lauched by GIT will execute the pre-commit-hook task. In this example, the behaviour is that before commiting in git php syntax will be verified and PhpUnit tests passed.
Reference
Global configurations
- Global configuration
Commands
- Git Hooks Installer
- SecurityChecker
- Lint
- PhpUnit
- PhpCpd
- PhpCs
- PhpCsFixer
- Gulp
- Write
Misc
- Create custom script
- Composer useful configurations
- Symfony usual configuration
- Common problems
- Examples
Note for Windows users
Windows platform is not fully supported. This tool is not tested under Windows environments.
License
This project is licensed under the terms of the MIT license. See the LICENSE file.
All versions of composer-ci-tools with dependencies
symfony/process Version ~2.3|~3.0
symfony/filesystem Version ~2.3|~3.0
symfony/options-resolver Version ~2.3|~3.0