rki-mf1 / covsonar

A database-driven system for handling genomic sequences of SARS-CoV-2 and screening genomic profiles.
GNU General Public License v3.0
6 stars 0 forks source link

Add pre-commit hooks to update formatting and run linter #60

Closed matthuska closed 2 years ago

matthuska commented 2 years ago

Now that we have no flake8/linter messages (thanks @silenus092 !) we can enable pre-commit hooks to only allow a commit when there are no linter messages. Additionally the hooks will check for import formatting and code formatting using zimports and black, and automatically make the necessary changes. Just do "git commit" again if there are only formatting changes, they files will have been modified by black/zimports/etc already.

Be sure to run pre-commit install in the covsonar/ repo directory to install these (I added this to the CONTRIBUTING.md TLDR).

matthuska commented 2 years ago

I just noticed that the end of line formatter is messing with .tsv files. I'll abort this for now and find a workaround.

matthuska commented 2 years ago

Please "Squash and merge" this if you accept it, so that the changes to the meta.tsv file are not in the history (the file was modified and then reverted in the next commit).