Fix metadata attribute #950
Replies: 2 comments 4 replies
-
Hello, I'm not sure how that fix metadata attribute should work? You might indeed want to add a fixer for a shell task. Can you give me a more concrete example of what you are trying to achieve? |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for your fast response! Of course, it won't (and couldn't) be automatic. It would just be a "scripts-like" attribute, it would just execute the given scripts/commands. I see it like this: # grumphp.yml
grumphp:
tasks:
shell:
scripts: []
triggered_by: [php]
fix: [] So for my usecase: # grumphp.yml
grumphp:
tasks:
header-stamp:
metadata:
task: shell
scripts:
- [
"-c",
'vendor/bin/header-stamp --dry-run
--extensions="php,js,css,scss,tpl,html.twig,vue" --exclude="config,var,vendor" --license="_dev/header-stamp/afl.txt"',
]
fix:
- [
"-c",
'vendor/bin/header-stamp
--extensions="php,js,css,scss,tpl,html.twig,vue" --exclude="config,var,vendor" --license="_dev/header-stamp/afl.txt"',
] In fact, I could do a custom task (I did a composer script atm), but it makes more sense to me to have it built into the dedicated autofix tool. |
Beta Was this translation helpful? Give feedback.
-
It could be great to add a
fix
metadata attribute to any task, or at least afix
attribute for shell task.GrumPHP would use it to autofix the code, as with PHP-CS-Fixer:
Beta Was this translation helpful? Give feedback.
All reactions