8000 ci: Add pre-commit by j-s-ashley · Pull Request #12 · thaler-lab/Wasserstein · GitHub
[go: up one dir, main page]

Skip to content

ci: Add pre-commit #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Conversation

j-s-ashley
Copy link
Member

Adds pre-commit to resolve #11.

@j-s-ashley
Copy link
Member Author
j-s-ashley commented May 29, 2024

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

Copy link
Contributor
@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@j-s-ashley Looks good, but I would rebase and squash the pre-commit.ci changes that were pushed back with your previous commit so that all the changes are in 1 commit.

@matthewfeickert
Copy link
Contributor

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. matplotlib/matplotlib#22809 for an example of this.

* Add pre-commit config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@henryiii
Copy link
Contributor

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.

Copy link
Contributor
@henryiii henryiii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing unused whitespace is good change, IMO. :)

Copy link
Contributor
@matthewfeickert matthewfeickert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I'd personally leave these in two commits, and rebase and merge.

That's what I was trying to communicate, but I see how my

all the changes are in 1 commit.

could be confusing (I meant all the pre-commit applied changes).

Anyway, this LGTM so @rikab this is ready for your review.

@matthewfeickert
Copy link
Contributor
matthewfeickert commented Jun 11, 2024

@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.

@j-s-ashley j-s-ashley merged commit e4478c1 into thaler-lab:master Jun 11, 2024
@j-s-ashley j-s-ashley deleted the ci/pre-commit branch June 11, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pre-commit.ci
3 participants
0