drupol / backdrop-conventions
Backdrop conventions for coding.
0.1.5
2019-06-04 13:06 UTC
Requires
- php: >= 5.6
- backdrop/coder: ^1
- friendsofphp/php-cs-fixer: ^2.15
- jakub-onderka/php-parallel-lint: ~1
- phpro/grumphp: ~0.12.1 || ~0.15
- symfony/yaml: ^3.4 || ^4.2
Suggests
- symplify/coding-standard: The LineLength fixer needs this library. Only PHP >= 7.
README
This tool will check your code against Backdrop's coding standard.
It's based on GrumPHP and comes with a default configuration tailored for Backdrop development.
The following checks are triggered:
- Backdrop coder code sniffer's checks
- Custom PHP CS Fixer configuration
- PHPLint
- YAMLlint
- JSONlint
Installation
composer require drupol/backdrop-conventions --dev
If you're not using GrumPHP
Manually add to your composer.json
file:
"extra": { "grumphp": { "config-default-path": "vendor/drupol/backdrop-conventions/config/backdrop/grumphp.yml" } }
If you're using GrumPHP already
Edit the file grumphp.yml.dist
or grumphp.yml
and add on the top it:
imports: - { resource: vendor/drupol/backdrop-conventions/config/backdrop/grumphp.yml }
To add an extra Grumphp task:
imports: - { resource: vendor/drupol/backdrop-conventions/config/backdrop7/grumphp.yml } parameters: extensions: - drupol\BackdropConventions\GrumphpTasksExtension extra_tasks: phpunit: always_execute: false
In conjunction with extra_tasks
, use skip_tasks
to exclude default tasks if needed.
Usage
./vendor/bin/grumphp run
Contributing
Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)