symfony - Run PHP CS fixer with GrumPHP -


i'm using grumphp sniff commit in symfony project: https://github.com/phpro/grumphp

here config:

parameters:     git_dir: .     bin_dir: vendor/bin     tasks:         phpcsfixer:             config_file: ~             config: sf23             fixers: [psr2, symfony, indentation]             level: psr2             verbose: true 

my question is:

is there way grumphp automatically run php-cs-fixer when commiting?

yes there is! https://github.com/phpro/grumphp/blob/master/doc/tasks.md

since post bit older here new updated doc, can still use version one! https://github.com/phpro/grumphp/blob/master/doc/tasks/php_cs_fixer2.md

you try out configuration it's phpcsfixer version2!:

# grumphp.yml parameters:     bin_dir: "./vendor/bin"     git_dir: "."     hooks_dir: ~     hooks_preset: local     stop_on_failure: false     ignore_unstaged_changes: false     process_async_limit: 10     process_async_wait: 1000     process_timeout: 60     ascii:         failed: grumphp-grumpy.txt         succeeded: grumphp-happy.txt     tasks:         phpcsfixer2:         allow_risky: false         cache_file: ~         config: ~         rules: ['@symfony']         using_cache: true         path_mode: ~         verbose: true 

your config looks fine, what's output ? have cs fixer installed , configured grumphp config path of cs fixer? https://github.com/friendsofphp/php-cs-fixer#usage


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -