Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pre-commit config + fixes#21638

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
ianhi wants to merge3 commits intomatplotlib:mainfromianhi:pre-commit-all
Closed

Conversation

ianhi
Copy link
Contributor

PR Summary

As discussed in#21583 (comment) this PR adds a pre-commit config and then:

  1. Fixed the docstring-first-check manually
  2. applies the autofixes from pre-commit

PR Checklist

Tests and Styling

  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

Update pre-commit hooksrst formatDisable autofixes on PRsUnless manually triggered. Seehttps://pre-commit.ci/#configurationadd pre-commit to environment.ymlSlow down autoupdate schedulealphabetizeAdd sentence about where pre-commit config isAdd excludes to pre-commit configOtherwise end of lines of test images will get fixed,this also ignores all the prev_whats_new and prev_api_changesas well as vendored components (agg, gitwash)pre-comit config
@@ -60,6 +60,16 @@ true for ``*.py`` files. If you change the C-extension source (which might
also happen if you change branches) you will have to re-run
``python -m pip install -ve .``

Installing pre-commit hooks
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to talk about using them (ie.pre-commit run) instead of installing them? Personally I prefer not having pre-commit editing my files automatically.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

How about adding a discussion of running them with out installing as hooks following this?

Something like:

If you do not want these git hooks you can skip thepre-commit install step. You can still run the checks withpre-commit run <list of files> orpre-commit run --all-files

Copy link
Member

Choose a reason for hiding this comment

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

👍 sounds good to me

Copy link
Contributor

Choose a reason for hiding this comment

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

I thinkpre-commit run ... will still update/modify the files if that is what the hook is doing though? It is just if youinstall the hooks automatically get run on every commit without a user running the command explicitly.

👍 to changing this section title to "Using pre-commit hooks" and expanding the text.

@tacaswell
Copy link
Member

Do we need to have this much white-space churn?

@ianhi
Copy link
ContributorAuthor

Do we need to have this much white-space churn?

As established when talking aboutblack I'm a supporter of infinite amounts of churn... so that's a question I'm ill suited to answer. I think this rule is already enforced in py files by flake8 and this just extends it too all files. We could change that check to only run on py files.

@jklymak
Copy link
Member

When tracking what's going on in the codebase, it is nice if "git blame" points to substantive changes rather than whitespace "fixes"

@oscargus
Copy link
Member

When tracking what's going on in the codebase, it is nice if "git blame" points to substantive changes rather than whitespace "fixes"

But that is only going to happens once, right? Like when merging this.

(Or when people use editors that trim whitespaces.)

@jklymakjklymak marked this pull request as draftFebruary 1, 2022 12:16
@jklymak
Copy link
Member

needs a rebase so I've put to draft -@ianhi, happy to add this to the weekly call if you want to see if this will go in or not. Ithink we talked about it previously and the general opinion was 👍, but not sure...

@QuLogic
Copy link
Member

I'm pretty sure all of this has been applied in other PRs now.

@QuLogicQuLogic added status: duplicate and removed status: needs comment/discussionneeds consensus on next step labelsJul 21, 2022
@ianhiianhi deleted the pre-commit-all branchJuly 21, 2022 00:27
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dstansbydstansbydstansby left review comments

@greglucasgreglucasgreglucas left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@ianhi@tacaswell@jklymak@oscargus@QuLogic@dstansby@greglucas

[8]ページ先頭

©2009-2025 Movatter.jp