See comment by @davidscn in #705 (comment)
pre-commit just executes this script, which does not distinguish if the files are staged or not: https://github.com/precice/tutorials/blob/develop/tools/check-image-names.py
The rest of the custom scripts we use should show the same behavior.
We could either guard the scripts, or maybe there are options in pre-commit.