Skip to content
Next Next commit
Run pre-commit as part of 'make patchcheck'
  • Loading branch information
hugovk committed Sep 25, 2023
commit dff437b42ca53f884444e87f90ba3118e26b5517
2 changes: 2 additions & 0 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,8 @@ funny:
.PHONY: patchcheck
patchcheck: all
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/patchcheck/patchcheck.py
@$(RUNSHARED) ./$(BUILDPYTHON) -m pre_commit --version >/dev/null 2>&1 || $(RUNSHARED) ./$(BUILDPYTHON) -m pip install pre-commit >/dev/null 2>&1
$(RUNSHARED) ./$(BUILDPYTHON) -m pre_commit run --all-files
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think make patchcheck should run pre commit, especially if the goal is to remove it. Hence I'd say this is a docs point to communicate.

Suggested change
@$(RUNSHARED) ./$(BUILDPYTHON) -m pre_commit --version >/dev/null 2>&1 || $(RUNSHARED) ./$(BUILDPYTHON) -m pip install pre-commit >/dev/null 2>&1
$(RUNSHARED) ./$(BUILDPYTHON) -m pre_commit run --all-files

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm thinking it would be a good idea to add a make lint target like we have for the PEPs repo (and Pillow), which seems to work there.

Perhaps we should add make lint now and have it run pre-commit; and maybe also patchcheck?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd agree. We should also update the devguide (currently only patchcheck is mentioned)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've removed the Makefile changes from this PR, let's decide what to later after discussion:

https://discuss.python.org/t/do-you-use-make-patchcheck/34743?u=hugovk


.PHONY: check-limited-abi
check-limited-abi: all
Expand Down