• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

✨ CLI command with sane defaults to simplify CodeSniffer and PHP-CS-Fixer

A single CLI command with sane defaults to simplify CodeSniffer and PHP-CS-Fixer.


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.

Now it's easy, simply run:

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.

If errors are found, simply run:

pretty fix

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

Installation

If you have already set up a global install of Composer just run:

composer global require mnapoli/pretty

Pretty comes with no dependencies so it should not bring any conflict in Composer.

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.

You will be able to update to new versions by running:

composer global update mnapoli/pretty

Usage

Running an analysis is as simple as running:

pretty

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

pretty fix

In case you are running the analyses in CI you might want to run:

pretty ci

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

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.

More Repositories

1

silly

Silly CLI micro-framework based on Symfony Console
PHP
880
star
2

IsItMaintained

Monitor open source projects activity
PHP
320
star
3

FrontYAML

YAML Front matter parser
PHP
281
star
4

externals

Opening PHP's #internals to the outside
PHP
231
star
5

phpBeanstalkdAdmin

[UNMAINTAINED] Beanstalkd admin interface
PHP
132
star
6

dbal-schema

DB schema manager for Doctrine DBAL
PHP
96
star
7

sqlite-s3

Serverless dev database: SQLite backed by S3
PHP
87
star
8

aoe2-de-macos

How to run Age of Empires 2 DE on macOS
83
star
9

bof

The HTTP client for humans
PHP
79
star
10

fluent-symfony

Fluent configuration for Symfony
PHP
78
star
11

github-to-aws

Set up GitHub Actions to deploy to AWS
JavaScript
73
star
12

serverless-pdf-generator

Serverless PDF generator
JavaScript
59
star
13

project-template

This is a template for new PHP projects
58
star
14

bref-laravel-demo

Demo of a Laravel application deployed on AWS lambda using Bref
PHP
54
star
15

phpunit-easymock

Build PHPUnit mocks easily
PHP
38
star
16

simple-s3

Simple, single-file and dependency-free AWS S3 client.
PHP
36
star
17

bref-symfony-demo

[DEPRECATED] Demo of a Symfony application deployed on AWS lambda using Bref
PHP
33
star
18

imapi

[EXPERIMENTAL] High level IMAP API for PHP
PHP
24
star
19

bref-bootstrap-benchmarks

Benchmark of possible solutions for Bref and the new AWS Lambda runtime API
PHP
22
star
20

bref-laravel-sqs-demo

Example project for using Laravel with SQS on AWS Lambda
PHP
17
star
21

zsh-symfony-console-plugin

Oh My Zsh plugin for the Symfony Console component
Shell
16
star
22

BlackBox

[Experimental] Versatile storage library
PHP
15
star
23

sniff

Simpler PHP code sniffer built on top of PHP-CS-Fixer.
PHP
14
star
24

gh-pages-compiler

Automatic website generation from Markdown documentation. Deprecated! Use this instead:
JavaScript
14
star
25

mnapoli.fr

My blog
CSS
12
star
26

simplex

Pimple fork with full PSR-11 and container-interop support
PHP
12
star
27

docker-php7

Docker image for PHP 7 containing Composer and Puli
11
star
28

MatomoTwigExtension

Twig extension to provide Piwik integration
PHP
11
star
29

framework-interop

Run several web frameworks in a single application
PHP
11
star
30

gitstats

Iterate through git commits to gather statistics
PHP
10
star
31

DoctrineTranslated

Translated strings for Doctrine
PHP
10
star
32

workshop-middlewares

CSS
10
star
33

supercharge

PHP
9
star
34

bepo

Custom version of the french dvorak keyboard layout
C
8
star
35

hard-mode

PHP hard mode
8
star
36

assembly

[EXPERIMENTAL] Implementation of container-interop/definition-interop
PHP
7
star
37

NumberTwo

A classy variable dumper
PHP
7
star
38

MetaModel

[Experimental] Language for traversing and performing actions on your model
PHP
6
star
39

cloudformation-force-delete

Clean up old CloudFormation stacks
JavaScript
6
star
40

Transform

[Experimental] Transform [objects, array] to [objects, array]
PHP
5
star
41

minimal-app

Minimalistic web application built using PHP-DI
PHP
5
star
42

escapedev-claps

PHP
4
star
43

MetaConsole

[Experimental] CLI console that let's you use MetaModel in your PHP app
PHP
4
star
44

aws-sdk-sso-device-auth

Utility to use SSO auth with the AWS SDK v3
TypeScript
4
star
45

phpLogViewer

[Unmaintained] Simple webapp for viewing server logs
PHP
3
star
46

html-template

This is an empty HTML website template
HTML
3
star
47

mockup

[EXPERIMENTAL] Concise mock library for PHP tests.
PHP
3
star
48

ReflectionBenchmark

Benchmark of all methods allowing access to private properties
PHP
3
star
49

php-static-analyzer

PHP static analyzer - Work in progress
PHP
3
star
50

procedure

A web framework built on Symfony with procedural controllers
3
star
51

telemetry-proxy

Rust
2
star
52

PHPBench

Deprecated, use this instead:
PHP
2
star
53

MniPagesBundle

Pages and components in Symfony 2
PHP
2
star
54

test-magento-prettyci

PHP
2
star
55

bref-apiplatformdemo

JavaScript
2
star
56

silly-php-di

The PHP-DI edition of Silly CLI
PHP
2
star
57

bref-example-docker-image

Example of using a single Docker image for a function and console function
PHP
2
star
58

silly-pimple

The Pimple edition of Silly CLI
PHP
2
star
59

Calculette-Carbone-Electromenager

Calculette Carbone Électroménager
JavaScript
2
star
60

test-localstack

PHP
2
star
61

mnapoli

1
star
62

enum-doctrine

Doctrine integration for myclabs/php-enum
PHP
1
star
63

psr-aliases

Aliases for PSR interfaces without the Interface suffix
PHP
1
star
64

Calculette-Carbone-Voyage

JavaScript
1
star
65

Aspect-PHP

[Unmaintained] Aspect oriented framework for PHP
PHP
1
star
66

pizza-king

PHP
1
star
67

simple-bref-example

PHP
1
star
68

test-ci-code-style

Just a test repository
PHP
1
star
69

dotfiles

My dotfiles
Shell
1
star
70

benchmarking-dependency-injection-containers

A benchmark of several popular Dependency Injection Containers. Contains usage and benchmarking on Zend\Di, Illuminate\Container (Laravel), Pimple, Symfony\DependencyInjection and Orno\Di.
PHP
1
star