thaler-lab / Wasserstein

Python/C++ library for computing Wasserstein distances efficiently.
https://thaler-lab.github.io/Wasserstein
Other
21 stars 8 forks source link

ci: Add pre-commit #12

Closed j-s-ashley closed 1 month ago

j-s-ashley commented 1 month ago

Adds pre-commit to resolve #11.

j-s-ashley commented 1 month ago

@matthewfeickert and @henryiii, mind giving this a review?

matthewfeickert commented 1 month ago

I should also say that in a follow up PR to this PR, to keep git blame treating everything here as a real change (this is all cosmetic) a .git-blame-ignore-revs file can be used to have GitHub automatically ignore the commit that will be generated when this is merged.

c.f. https://github.com/matplotlib/matplotlib/pull/22809 for an example of this.

henryiii commented 1 month ago

That's why I'd personally leave these in two commits, and rebase and merge. The manual changes (adding the .pre-commit file) in one, and one fully automated change that can be added to the .git-blame-ignore-revs file. But you are only losing a tiny bit (blame on the .pre-commit-config.yaml file) for doing it all in one.

Also makes it easier if you ever need to rebase, you can just drop the fully automated comment and rerun pre-commit to remake it.

matthewfeickert commented 1 month ago

@rikab Ping on merging this.

As this is something that both @henryiii and I strongly advocate for, we'll have @j-s-ashley merge this in by the end of the day if you don't have any comments. If you later do have any, we can revisit this.