macisamuele / language-formatters-pre-commit-hooks

Collection of custom pre-commit hooks.
Apache License 2.0
116 stars 58 forks source link

Improve failure messages #110

Closed jenstroeger closed 2 years ago

jenstroeger commented 2 years ago

I just spent an hour wondering while an INI file fails the hook, until I manually loaded it using the ConfigParser (which is what the hook does, too). So, I think to make failures a bit more useful change

https://github.com/macisamuele/language-formatters-pre-commit-hooks/blob/64de10e82284e45575fbd08105c93af4bffb185c/language_formatters_pre_commit_hooks/pretty_format_ini.py#L52-L54

to

 except Error as error:
     print("Input File {0} is not a valid INI file: {1}".format(ini_file, str(error))) 
     return 1

or some such? Thanks!

macisamuele commented 2 years ago

Handled in #113 :)