As a developer, I have an easy way to check my commit and code locally before pushing
I was talking to ggainey about some of the automation checks we have in pulp (commit validation, style/lint checks, changelog, etc) and how it might be frustrating for new devs. I've heard the same feedback from other contributors such as galaxy.
We need to provide an easy way for developers to run our CI checks locally. I've seen other projects (bandersnatch, black, celery, etc) use pre-commit:
#2 Updated by ggainey over 1 year ago
None of the individual bookeeping tasks are bad - they're all great individually - but en masse, they cause a lot of friction for the dev, which is a good way to get people to not-contribute to your project
- "check for issue/noissue"
- "check for coverage/nocoverage"
- "check issue is in project"
- "check for CHANGES existence"
- "check that CHANGES file has an allowed suffix"
are all checks that happen serially in travis, and which therefore will fail individually. So if you're particularly dense (like I have been on frequent occasions), that can mean SIX separate pushes/builds, just to get to the point where travis will tell you if your code even builds/works.
#3 Updated by fao89 over 1 year ago
- Groomed changed from No to Yes
- Sprint Candidate changed from No to Yes
We can start a new directory on plugin_template or use .travis one. It needs to be customizable by plugins, as only pulp_rpm needs [nocoverage]. Maybe calling a script "additional_checks.sh": https://stackoverflow.com/a/59499550 It would be helpful to have a makefile for facilitating setting and using the pre-commit
install: pip install --upgrade pip pip install -r requirements_dev.txt make setup-pre-commit setup-pre-commit: pre-commit install pre-commit install-hooks run-pre-commit: rm -rf .tox/ pre-commit run --files $$(find -regex '.*\.\(py\|yaml\|yml\|md\)') -v
#6 Updated by daviddavis over 1 year ago
Thanks for the article. I posted a small PoC:
Please register to edit this issue