N-Wouda / ALNS

Adaptive large neighbourhood search (and more!) in Python.
https://alns.readthedocs.io/en/latest/
MIT License
447 stars 124 forks source link

Add pre-commit + isort #112

Closed leonlan closed 1 year ago

leonlan commented 1 year ago

Closes #90.

codecov[bot] commented 1 year ago

Codecov Report

Merging #112 (f1bc543) into master (b42f503) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #112   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines          664       664           
=========================================
  Hits           664       664           
Impacted Files Coverage Δ
alns/stop/MaxRuntime.py 100.00% <ø> (ø)
alns/select/RouletteWheel.py 100.00% <100.00%> (ø)
alns/select/SegmentedRouletteWheel.py 100.00% <100.00%> (ø)
alns/stop/NoImprovement.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

N-Wouda commented 1 year ago

If we move all dev stuff into pre-commit, can we then get rid of the dev dependencies in pyproject.toml? I think so, if we update the CI to install and run the pre-commit thing as well?

N-Wouda commented 1 year ago

If we move all dev stuff into pre-commit, can we then get rid of the dev dependencies in pyproject.toml?

Then we can probably also get rid of a lot of the settings in pyproject.toml.

leonlan commented 1 year ago

If we move all dev stuff into pre-commit, can we then get rid of the dev dependencies in pyproject.toml? I think so, if we update the CI to install and run the pre-commit thing as well?

I read somewhere that testing is not recommended to be part of pre-commit. I guess that's mainly in very large codebases, which have much longer tests than we do have here. I think it's fine if we do add pytest to pre-commit.

So yes, we can put everything in pre-commit.

N-Wouda commented 1 year ago

I read somewhere that testing is not recommended to be part of pre-commit. I guess that's mainly in very large codebases, which have much longer tests than we do have here. I think it's fine if we do add pytest to pre-commit.

I meant just the linting and static type checker stuff. The test and coverage stuff can stay, I think.

N-Wouda commented 1 year ago

Much better!