TMP / pre-commit refuses to run if no files are staged

This commit is contained in:
OLEGSHA 2023-03-09 23:32:39 +01:00
parent 9d5ce3dca2
commit 7e39188f80

View File

@ -218,6 +218,10 @@ def pre_commit():
if verbose_mode:
long_print_iter('Indexed changes', indexed)
long_print_iter('Unindexed changes', unindexed)
if len(indexed) == 0:
fail('No indexed changes. You probably forgot to run `git add .`')
run_safety_checks(indexed, unindexed)
undo_formatting = False