ci: add matchify pre-commit hook - #15356
kadubhumika wants to merge 6 commits into
Conversation
|
Hi @cclauss @priya-sundaram-dev , The merge conflicts have been resolved and all required checks are now passing. |
priya-sundaram-dev
left a comment
There was a problem hiding this comment.
Thanks for resolving the conflicts, @kadubhumika! One thing to flag before this can go in, though — right now the PR has no net change. Comparing the branch against master:
$ git diff master...add-matchify-precommit --stat
(0 files changed)
GitHub agrees: the PR shows 0 changed files. It looks like the last merge commit (6b907e5 Merge branch 'master') resolved the conflict in .pre-commit-config.yaml by taking master's side, which discarded the matchify hook that commit 6d6eee5 had added. matchify no longer appears anywhere in the branch's .pre-commit-config.yaml, so as it stands merging this wouldn't add the hook.
To fix: re-apply the matchify block on top of the current merged state, e.g.
- repo: https://github.com/15r10nk/matchify
rev: <pinned-version>
hooks:
- id: matchify
exclude: ^data_structures/linked_list/doubly_linked_list\.py$(keeping the doubly_linked_list.py exclusion you mentioned, since the rewritten pattern is less readable there). Once git diff master... shows the hook being added again and CI is green, happy to re-review. 🙂
6b907e5 to
dae13f1
Compare
for more information, see https://pre-commit.ci
| rev: "0.26" | ||
| hooks: | ||
| - id: validate-pyproject | ||
| - repo: https://github.com/15r10nk/matchify |
There was a problem hiding this comment.
The rest of the file leaves a blank line between hooks for readability.
| - repo: https://github.com/15r10nk/matchify | |
| - repo: https://github.com/15r10nk/matchify |
|
Please run: |
|
Confirmed — the hook is now genuinely applied: One thing to watch on @cclauss's |
|
@cclauss @priya-sundaram-dev Thanks for the feedback! I’ve run |
|
@priya-sundaram-dev In #15337 (comment) you flagged the matchify change in one file. Do you flag any matchify changes in this pull request? Are the files more or less verbose with these changes? |
|
Good question — I went through the whole diff for this PR, not just spot-checks. Do I flag any conversion here? No. The thing I flagged in #15337 was one specific construct: a dotted value-pattern (
None of those can be misread as a capture, so I'd be happy to see them land. More or less verbose? Marginally more by line count, not by complexity. There are ~48 |
|
Awesome teamwork. I approve this, but I am going to hold off on merging it until just before Hacktoberfest 2026 starts. If not, it will cause many of our 375 pull requests to fail in CI. Once we have far fewer PRs, we will rerun and test this, and then merge it. Really awesome work!! Thanks much. |
Summary
data_structures/linked_list/doubly_linked_list.pybecause itsconversion produces a less readable
case self.headpattern.Testing
pre-commit validate-configpassed.pre-commit run --all-fileswas run.doubly_linked_list.pyremains excluded from Matchify.Fixes #15337
Describe your change
Checklist