Proof read generated code immediately for pluralization and type errors

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the workflows category.

Last Updated: 2024-04-26

In Laravel, I wrote

php artisan backpack:crud users

instead of

php artisan backpack:crud user

This generated like 10 files that were incorrect, and I only realized after I had made subsequent modifications to a bunch of them that were not so easy to undo.

Lesson:

When using code generators, be incredibly careful with double-checking the command for singulars/plurals/typos etc. early in the process (i.e. proof-read the code and commit immediately)

You probably should start the auto-generated after a fresh commit as well to enable easier undo.