Skip to content

Released version 1.4.0

Choose a tag to compare

@dg dg released this 11 Nov 00:05
· 35 commits to master since this release

Starting with DressCode no longer means writing a configuration. dresscode init measures your code and writes one that fits it, and a project coming from PHP CS Fixer, PHP_CodeSniffer or Laravel Pint brings its configuration and its suppression comments along.

  • dresscode init – takes the measurements of your code (indentation, line width, quotes, where a condition spread over lines begins and ends, and every other decision), picks the standard closest to it and writes a dresscode.neon made to measure, with the scope your formatter or git already knows and generated files and test data left out. Where the code leaves a choice open, it asks, showing what the fix would do to a real place in your code; --dry-run only prints the proposal, --yes takes the recommended answers
  • Standards symfony and laravel – the Symfony Coding Standards as the @Symfony set of PHP CS Fixer has them, and the style Laravel Pint writes by default, beside perCs, psr12 and nette
  • dresscode migrate config – finds the configuration of PHP CS Fixer, PHP_CodeSniffer (Slevomat included) or Laravel Pint the project runs, translates its rules and their options to dresscode.neon and lists at the end of the file what it could not carry over. explain and the catalogue show the names each decision has in those tools
  • phpcs comments keep working – phpcs:ignore, phpcs:disable/enable, phpcs:ignoreFile and @phpcsSuppress silence the decisions their sniff translates to, so the code needs no change on the first day; dresscode migrate suppressions rewrites them to dresscode:ignore whenever you like
  • Baseline found by itself – a dresscode-baseline.neon in the root applies without the configuration naming it, and the header of check says which baseline is in use. A baseline the configuration names must now exist