vturrisi / solo-learn

solo-learn: a library of self-supervised methods for visual representation learning powered by Pytorch Lightning
MIT License
1.42k stars 185 forks source link

Add precommit hooks #304

Closed turian closed 2 years ago

turian commented 2 years ago

This is a nice way to keep new pushed code black'ed. (I see you also have a github action for this.)

I see use you --line-length 100 so I added that too.

To get this working, simply run:

pre-commit install

once.

codecov[bot] commented 2 years ago

Codecov Report

Merging #304 (7cdf914) into main (5bd403d) will decrease coverage by 0.07%. The diff coverage is n/a.

Additional details and impacted files | Flag | Coverage Δ | | *Carryforward flag | |---|---|---|---| | cpu | `81.66% <ø> (ø)` | | | | dali | `40.06% <ø> (ø)` | | Carriedforward from [73eea67](https://codecov.io/gh/vturrisi/solo-learn/commit/73eea67eb60e9f9e1a6ce2dbf4f29badbbbe7d32?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi) | *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi) to find out more. | [Impacted Files](https://codecov.io/gh/vturrisi/solo-learn/pull/304?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi) | Coverage Δ | | |---|---|---| | [solo/methods/base.py](https://codecov.io/gh/vturrisi/solo-learn/pull/304/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Victor+Turrisi#diff-c29sby9tZXRob2RzL2Jhc2UucHk=) | `78.13% <ø> (-0.85%)` | :arrow_down: |
turian commented 2 years ago

@vturrisi I think this is okay to merge, if you are okay with it. The codecoverage claims to have decreased, but as you can see this is only because of black'ing the file and removing two lines (thus decreasing the "coverage")

vturrisi commented 2 years ago

Hi @turian. I'll be away this weekend, but I'll check as soon as I come back. Thanks for contributing.