Plugin - formating code in 2 styles
First of all I must say that I'm pleased user of PhpStorm :) Thank you developers for you good work.
I'm not fluent in English, so I'm sorry for the mistakes I might make
My problem:
My new company has completely different coding style standard than the one I used to. I can make 2 different code styles in PhpStorm (with almost all rules), however switching them all the time is not acceptable.
I came up with idea of plugin:
When I open any file it is automaticaly formated with my style. When I commit changed files plugin formats the code with company style. Sounds logicaly for me.
I would try to write this plugin, but please make me sure that it is possible. I do not want to lose time for lerning SDK.
I know about git filters (clean, smudge) I tried them with PHP_CodeSniffer (beautifier app) however this library has not enough rules to properly format code.
And as far as I know PhpStorm has no CLI command that would allow me to perform those actions.
Please sign in to leave a comment.
We're working on it, please vote: https://youtrack.jetbrains.com/issue/IDEA-170216
Voted. However I dont want to wait for implementing this feature by dev team. Like I said I would like to write plugin by my own. Probably I will need to take the risk.
Hi,
Sure, this might be possible. As a hint, it might be good to know that you can reformat your code via CLI: https://www.jetbrains.com/help/phpstorm/command-line-formatter.html .
Thank you for that hint.
In IDE there is option to reformat only lines changed comparing by VCS (Reformat code dialog). Is it possible with CLI formatter?