Building on the awesome CLI extensions introduced in #149, I'd love to suggest an enhancement focused purely on the local Developer Experience (DX).
The Context:
While CI integration is fantastic, relying on it means developers have to push to the server just to find out if they missed a deprecation warning. On the flip side, running a full local test suite just to check deprecations can be slow and sensitive to local noise.
Using a pre-commit hook solves this by providing a clear, fast signal right on the developer's machine before they even push.
Proposed Solution:
To make this local workflow frictionless, we should do two things:
- Enable Path Compatibility (Code): For pre-commit to be fast and not noisy, it passes specific file paths (only the files the user is staging) to the hook. We need to ensure the
pyDeprecate CLI/entry point natively accepts these file paths as arguments so it plays nicely with the pre-commit framework.
- Add Quick Docs (Docs): Add a short section in the README showing users exactly how to set this up.
What the UX should look like:
Example to add to the README for .pre-commit-config.yaml:
repos:
- repo: [https://github.com/Borda/pyDeprecate](https://github.com/Borda/pyDeprecate)
rev: <latest_version>
hooks:
- id: pydeprecate
Example of the local run commands to feature in the docs:
# Get a clear signal on staged files before pushing:
pre-commit run pydeprecate
# Or check the whole repo:
pre-commit run pydeprecate --all-files
Why this matters:
This is all about saving developer time. By ensuring the hook accepts file paths correctly and documenting the setup, we give users a clean, out-of-the-box way to catch deprecations locally without the noise of a full test suite or the delay of a CI run.
Let me know what you think! I'd be happy to help put together a PR for this.
Building on the awesome CLI extensions introduced in #149, I'd love to suggest an enhancement focused purely on the local Developer Experience (DX).
The Context:
While CI integration is fantastic, relying on it means developers have to push to the server just to find out if they missed a deprecation warning. On the flip side, running a full local test suite just to check deprecations can be slow and sensitive to local noise.
Using a
pre-commithook solves this by providing a clear, fast signal right on the developer's machine before they even push.Proposed Solution:
To make this local workflow frictionless, we should do two things:
pyDeprecateCLI/entry point natively accepts these file paths as arguments so it plays nicely with the pre-commit framework.What the UX should look like:
Example to add to the README for
.pre-commit-config.yaml:Example of the local run commands to feature in the docs:
Why this matters:
This is all about saving developer time. By ensuring the hook accepts file paths correctly and documenting the setup, we give users a clean, out-of-the-box way to catch deprecations locally without the noise of a full test suite or the delay of a CI run.
Let me know what you think! I'd be happy to help put together a PR for this.