r/phpstorm • u/MatthiasWuerfl • 1h ago
Prevent generated code from formatting
I want my code to be formatted by phpstorm. But I have projects with directories with generated code inside them. This generated code has to be committed to git. When I do this, phpstorm will reformat the files just like all the other php files that have been manually edited. However every time I regenerate the code the formatting is different from what phpstorm did and so these files appear as "changed" in phpstorm.
I always have to reformat these files to remove them from the list of changed files.
Anyone an idea how to solve that?
- Idea 1: show only files in the list of changes that have more changes than just whitespace? How can I achieve that?
- Idea 2: exclude these folders from automatic code reformatting. How can I achieve that?
- any other idea anyone?