Closed j3rrey closed 7 years ago
Thanks for reporting @j3rrey,
GrumPHP is using the Symfony service container. This means that you'll have to escape the @
sign with a double @@
sign.
http://symfony.com/doc/current/service_container.html#service-parameters If you want to use a string that starts with an @ sign as a parameter value (e.g. a very safe mailer password) in a YAML file, you need to escape it by adding another @ sign (this only applies to the YAML format)
Can you validate if this solution is working for you? Is this a common notation for the php-cs-fixer rules? We might add this to the documentation of that parameter.
Hey @veewee,
yes this works, thx! It's new in the cs fixer v2 they changed parameters and rules now you use --rule=@PSR2 so on and to make it work with Grumphp you need to escape it as you said with another @ e.g. @@PSR2
My updated 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:
git_blacklist:
keywords:
- "die("
- "var_dump("
- "print_f("
- "dump("
- "dd("
- "exit;"
triggered_by: ["php"]
git_commit_message:
matchers:
- /SER-([0-9]*)/
case_insensitive: true
multiline: true
additional_modifiers: ''
git_conflict: ~
phpcsfixer2:
allow_risky: false
cache_file: ~
config: ~
rules: ['@@Symfony']
using_cache: false
path_mode: ~
verbose: true
phpmd:
exclude: []
ruleset: ['cleancode', 'codesize', 'naming']
triggered_by: ["php"]
phpparser:
ignore_patterns: []
kind: php7
triggered_by: ["php"]
visitors: {}
phpunit: ~
phpversion:
project: "7.0"
shell: ~
testsuites: []
extensions: []
I opened the issue on the PHP CS Fixer Repo
https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/2518
I'm digging into the Grumphp code trying to find the place where the @ get's stripped away
My configuration
One can make a workaround with a config file!
php_cs.dist
This will execute the cs fixer with the given values and won't strip away any of the rules important characters!
Updated grumphp.yml