Skip to content

Add pre commit + black #684

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 3 commits into from
Sep 15, 2023
Merged

Add pre commit + black #684

merged 3 commits into from
Sep 15, 2023

Conversation

nstarman
Copy link
Contributor

A maintainer will need to turn on pre-commit.ci to enforce pre-commit in the CI.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks @nstarman. The black reformatting looks like an improvement, in particular the signatures using one line per argument. I'm +1 on that change.

The larger style problem in this repo is that the docstring text doesn't have proper line breaks. I've looked at that before and unfortunately there's no tool that can deal with that automatically.

For pre-commit: I'd be fine with adding a check to CI (either pre-commit or simply black running in a CI job). However, I'd much prefer to get no bot PRs, those are just noise for both contributors watching the repo and in the commit history. Can we get this without autoupdate_schedule?

@rgommers rgommers added the Maintenance Bug fix, typo fix, or general maintenance. label Sep 12, 2023
@nstarman
Copy link
Contributor Author

nstarman commented Sep 12, 2023

The larger style problem in this repo is that the docstring text doesn't have proper line breaks. I've looked at that before and unfortunately there's no tool that can deal with that automatically.

At Astropy we've just started to use PyQA's docformatter in our pre-commit. docformatter can do some text regularization automatically.

For pre-commit: I'd be fine with adding a check to CI (either pre-commit or simply black running in a CI job). However, I'd much prefer to get no bot PRs, those are just noise for both contributors watching the repo and in the commit history. Can we get this without autoupdate_schedule?

Yes, using the GH action
https://pre-commit.ci/lite.html
I can add this to the PR.

@rgommers
Copy link
Member

Thanks! I tried some tools last year, but docformatter seems to have seen very active development recently - will try again.

@nstarman nstarman requested a review from rgommers September 12, 2023 13:53
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks @nstarman, this is looking pretty good to me now. Only one more comment.

basic layout

Signed-off-by: nstarman <[email protected]>
Signed-off-by: nstarman <[email protected]>
@rgommers rgommers added the CI Continuous Integration. label Sep 14, 2023
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

LGTM now, thanks a lot @nstarman.

I'll plan to squash-merge this very soon, and then push a follow-up commit with a new .git-blame-ignore-revs entry.

@rgommers rgommers merged commit 678f9ea into data-apis:main Sep 15, 2023
@nstarman nstarman deleted the add-pre-commit branch September 15, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration. Maintenance Bug fix, typo fix, or general maintenance.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants