Update pre-commit script for better automation