2017 © Pedro Peláez
 

project pretty

Run all code formatting tools with one command: pretty

image

mnapoli/pretty

Run all code formatting tools with one command: pretty

  • Thursday, July 19, 2018
  • by mnapoli
  • Repository
  • 7 Watchers
  • 77 Stars
  • 201 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 139 % Grown

The README.md

, (*1)

A single CLI command with sane defaults to simplify CodeSniffer and PHP-CS-Fixer., (*2)


PHP CodeSniffer and PHP-CS-Fixer are powerful but using them is not simple. It is not always obvious which tool a project uses and whether there is a configuration file to use or whether you need to provide options to the CLI command., (*3)

Now it's easy, simply run:, (*4)

pretty

Pretty will detect the configuration file that exist in the current directory and will run the correct tool. If no configuration file exist, Pretty will run PHP CodeSniffer with PSR-2 by default., (*5)

If errors are found, simply run:, (*6)

pretty fix

Again, Pretty will run the appropriate tool (php-cs-fixer or phpcbf) to fix as many errors as possible in your code., (*7)

Installation

If you have already set up a global install of Composer just run:, (*8)

composer global require mnapoli/pretty

Pretty comes with no dependencies so it should not bring any conflict in Composer., (*9)

You can also install it as a local dependency of your project with composer require --dev mnapoli/pretty. In that case you can start the tool with vendor/bin/pretty., (*10)

You will be able to update to new versions by running:, (*11)

composer global update mnapoli/pretty

Usage

Running an analysis is as simple as running:, (*12)

pretty

This command will not change any code. To fix errors reported by this command, simply run:, (*13)

pretty fix

In case you are running the analyses in CI you might want to run:, (*14)

pretty ci

This will disable the caching option of PHP-CS-Fixer or CodeSniffer (because the cache will not be kept in CI)., (*15)

Hosted continuous integration

If you are using pretty in your daily development workflow you may be interested in PrettyCI.com, the SaaS version of pretty., (*16)

The Versions

19/07 2018

dev-master

9999999-dev

Run all code formatting tools with one command: pretty

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

style code standard formatting coding pretty psr-2 psr-1

16/12 2017

1.0.2

1.0.2.0

Run all code formatting tools with one command: pretty

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

style code standard formatting coding pretty psr-2 psr-1

18/11 2017

1.0.1

1.0.1.0

Run all code formatting tools with one command: pretty

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

style code standard formatting coding pretty psr-2 psr-1

18/11 2017

dev-help

dev-help

Run all code formatting tools with one command: pretty

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

style code standard formatting coding pretty psr-2 psr-1

18/11 2017

1.0.0

1.0.0.0

Run all code formatting tools with one command: pretty

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

style code standard formatting coding pretty psr-2 psr-1

18/11 2017

0.1.1

0.1.1.0

Run all code formatting tools with one command: pretty

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

style code standard formatting coding pretty psr-2 psr-1

14/11 2017

0.1.0

0.1.0.0

Run all code formatting tools with one command: pretty

  Sources   Download

MIT

The Requires

  • php ^5.5|^7.0

 

style code standard formatting coding pretty psr-2 psr-1