Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm external tools before commit

Tags:

git

php

phpstorm

I have an External Tools entry php-cs-fixer and I want run it before commit. I found only after, but why after? I need before.

I want after work with file, commit it and don't worry about code style, I want to know that my PhpStorm run external tools php-cs-fixer before committed file.

enter image description here

How to add run external tools before commit ?

like image 204
shuba.ivan Avatar asked Oct 21 '25 16:10

shuba.ivan


1 Answers

There is no such built-in functionality.

https://youtrack.jetbrains.com/issue/IDEA-111943 -- watch this ticket (star/vote/comment) to get notification on any progress.


In addition to pre-commit git hooks .. you may try using File Watcher functionality so it automatically runs every time you save the file (some people are using such approach).

  • General info on File Watchers: https://confluence.jetbrains.com/display/PhpStorm/File+Watchers+in+PhpStorm
  • PHP CS Fixer File Watcher causes File Cache Conflict in PHPStorm (example usage)
like image 51
LazyOne Avatar answered Oct 23 '25 06:10

LazyOne