Open matthewfeickert opened 3 weeks ago
@scipy-conference/proceedings this is ready for review. Let me know if you have any questions. @tkoyama010 a review from you would be welcome also. :)
A markdown formatter should also be added, but the impact is too great and should be discussed carefully.
A markdown formatter should also be added, but the impact is too great and should be discussed carefully.
I like the idea, but as it would be a big diff
maybe we should do a follow up PR with it and codespell-project/codespell
as I think we'd need input from the proceedings team if they would want all those changes.
Closing to try pre-commit.ci
A note here for @scipy-conference/proceedings given Slack discussion. After this PR is merged this should get backported to the 2024
branch so that all the PRs targeting it for the 2024 proceedings will be targeting a branch with a .pre-commit-config.yaml
on it for pre-commit.ci to use.
edit: (Though GitHub won't notify new people tagged in an edit, so I've requested review) This should have been @scipy-conference/2024-proceedings. (Maybe the old team should get retired to avoid confusion.)
Is there some reason this branch seeks to make so many minor formatting and other changes to so many files other than just adding .pre-commit-config.yaml ?
@cbcunc Please read the PR body where this is explained: https://github.com/scipy-conference/scipy_proceedings/pull/1017#issue-2476970734
@cbcunc Please read the PR body where this is explained: #1017 (comment)
Does not explain why it needs to run on --all-files.
Does not explain why it needs to run on --all-files.
@scipy-conference/2024-proceedings Okay, let me try to unpack
The second commit in this PR is huge, but it is just applying the results of the added pre-commit hooks via
pre-commit run --all-files
as @tkoyama010 has started setting up pre-commit.ci (https://github.com/scipy-conference/scipy_proceedings/issues/1016#issuecomment-2299911858) and pre-commit.ci will run the equivalent of
pre-commit run --all-files
on each commit. This commit can get ignored automatically from GitHub'sgit blame
on diffs via adding it to a.git-blame-ignore-revs
(c.f. https://github.com/matplotlib/matplotlib/blob/1e8ea2f6ac758b331fb8b6838d69822424e86cb4/.git-blame-ignore-revs for an example).
in much more detail then.
pre-commit run --all-files
on every commit as a check. If any files in the repository don't pass then the check fails. It will try to push back fixes for those failing files, but if it can't the check fails. This is not a configurable behavior. If you use pre-commit.ci, it will always run over every file..pre-commit-config.yaml
. The second then applies the changes that running pre-commit run --all-files
will enforce and fixing those that it can't automatically get (c.f. the commit message for an example).I think that should explain why pre-commit run --all-files
was used.
As I also mentioned, I understand that this is a large change, and people generally don't want to have to deal with this noise when using git blame
to try to trace the history of changes through a file. This is why .git-blame-ignore-revs
exists, as it will be automatically picked up by GitHub and all the commits listed in it will be ignored for git blame
reasons. You can manually apply it at the command line with --ignore-revs-file
. Many projects do this to ignore big stylistic changes from their git blame
s, like turning on pre-commit
or adding a new linter (like black
or ruff
). Matplotlib is an example of one of those projects, so I list it here as an example if people want to see how they're using it.
I did not include a .git-blame-ignore-revs
in this PR as it requires the commit hash. If this was going to be squashed and merged then the commit hash would change and the file would be wrong. So I would suggest adding a .git-blame-ignore-revs
after this PR is in and the commits are known.
A note here for @scipy-conference/proceedings given Slack discussion. After this PR is merged this should get backported to the
2024
branch so that all the PRs targeting it for the 2024 proceedings will be targeting a branch with a.pre-commit-config.yaml
on it for pre-commit.ci to use.
Be aware that when this is backported to the 2024
branch there is already a .pre-commit-config.yaml
file there from PR https://github.com/scipy-conference/scipy_proceedings/pull/1018 that will get overwritten.
@scipy-conference/2024-proceedings I see from PR https://github.com/scipy-conference/scipy_proceedings/pull/925 that pre-commit.ci has been disabled as it doesn't show up in the checks and when you look at the pre-commit.ci page for the repo (https://results.pre-commit.ci/repo/github/1825629) it was disabled before the last pushes https://github.com/scipy-conference/scipy_proceedings/pull/925#commits-pushed-bba46c3.
Is there still interest in using pre-commit.ci (even if not while the 2024 proceedings are still in process)?
Is there still interest in using pre-commit.ci (even if not while the 2024 proceedings are still in process)?
Yes, after we're done with the 2024 process.
Is there still interest in using pre-commit.ci (even if not while the 2024 proceedings are still in process)?
In my original comment I should have mentioned incorporating use of pre-commit.ci after the 2024 proceedings are published. Thank you, @matthewfeickert and @tkoyama010, for your work on this.
Resolves #1016
The second commit in this PR is huge, but it is just applying the results of the added pre-commit hooks via
as @tkoyama010 has started setting up pre-commit.ci (https://github.com/scipy-conference/scipy_proceedings/issues/1016#issuecomment-2299911858) and pre-commit.ci will run the equivalent of
pre-commit run --all-files
on each commit. This commit can get ignored automatically from GitHub'sgit blame
on diffs via adding it to a.git-blame-ignore-revs
(c.f. https://github.com/matplotlib/matplotlib/blob/1e8ea2f6ac758b331fb8b6838d69822424e86cb4/.git-blame-ignore-revs for an example).