How to Apply Nette Coding Standard in Your Project
This year I started to work on a Nette Coding Standard (NCS) that you can put to CLI. And you'll be able set it up in in your project yourself today.
Nette\CodingStandard 2.0 was released 2 months. This version is ready to use, includes all important checkers and is used on all
Nette\* packages in Travis.
NCS checks every pull-request you make to Nette:
All that need is to define stage in
That's it! Just 2 commands and it checks any project you have.
This packages requires PHP 7.1 to run as the rest of the Nette (mostly current
Install the package to your dev dependencies:
composer require nette/coding-standard --dev
Good! Now just pick the prepared set.
At the moment there are 3 configs with set of checkers:
Just pick the one that suits you:
vendor/bin/ecs check src tests --config vendor/nette/coding-standard/coding-standard-php71.yml
Then, fix the code:
vendor/bin/ecs check src tests --config vendor/nette/coding-standard/coding-standard-php71.yml --fix
Config with higher PHP version includes all lower versions, so with
coding-standard-php71.yml you cover the other 2 configs as well.
❤️️ Do you like what I write about? Or do you hate it but enjoy discussion? 😠
You can support my writing by throwing a couple bucks at my Patreon