wellcometrust / grants_tagger

Tag grants with MeSH and other tags
MIT License
14 stars 4 forks source link

Add precommit hooks #213

Closed nsorros closed 2 years ago

nsorros commented 2 years ago

Description

Adds precommit hooks to the project so that we can share hooks and also ensure

The changes here affect DVC so a dvc commit probably needed to resolve status

Checklist

ivyleavedtoadflax commented 2 years ago

How come this failed in a black test. I thought the pre-commit hook would fix this? :thinking:

nsorros commented 2 years ago

In any case, happy to approve pending the test fix 🚀

Could it be a black version issue? .github/workflow: black==22.3.0 requirements.txt: black==21.7b0

In any case these two should probably be aligned?

It has to do with these versions indeed. There is a click error for version 21.7b0 which I have forced the action to use click 8.0.0 but not sure how to do that in pre-commit that uses a separate environment to run. So I thought I would use the latest black which does not have that error but then there is another problem which is that the action and precommit disagree on some rules.

One way to fix that is to remove black from the project unpinned and only run it through pre-commit and action which means we can use the latest black in both.

ivyleavedtoadflax commented 2 years ago

Good idea. LGTM :shipit:

nsorros commented 2 years ago

@aCampello any thoughts on this?

nsorros commented 2 years ago

@aCampello just a reminder for this