diff --git a/README.md b/README.md index 8c8130a..ccee3e3 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # Python Project Blueprint +[![Prek][prek-badge]](https://prek.j178.dev/) [![Mypy][mypy-badge]](https://mypy-lang.org) [![Ruff][ruff-badge]](https://github.com/astral-sh/ruff) [![Pytest][pytest-badge]](https://docs.pytest.org/en/stable/) @@ -10,7 +11,6 @@ [![Python Version][python-badge]](https://www.python.org/) [![License][license-badge]](LICENSE.md) -[![Pre-commit][pre-commit-badge]](https://github.com/pre-commit/pre-commit) [![PR Checks][pr-badge]](https://github.com/Pymetheus/python-project-blueprint/actions/workflows/pr-checks.yml) [![Security][security-badge]](https://github.com/Pymetheus/python-project-blueprint/actions/workflows/security.yml) [![CI][ci-badge]](https://github.com/Pymetheus/python-project-blueprint/actions/workflows/ci.yml) @@ -22,6 +22,7 @@ +[prek-badge]: https://img.shields.io/badge/prek-enabled-4180b1 [mypy-badge]: https://img.shields.io/badge/mypy-checked-4180b1 [ruff-badge]: https://img.shields.io/badge/ruff-linted-4180b1 [pytest-badge]: https://img.shields.io/badge/pytest-tested-4180b1 @@ -29,7 +30,6 @@ [snyk-badge]: https://img.shields.io/badge/snyk-scanned-4180b1 [python-badge]: https://img.shields.io/badge/python-3.12%2B-blue?color=4180b1 [license-badge]: https://img.shields.io/github/license/Pymetheus/python-project-blueprint?color=4180b1 -[pre-commit-badge]: https://img.shields.io/badge/pre--commit-enabled-31c553?logo=pre-commit&logoColor=white [pr-badge]: https://github.com/Pymetheus/python-project-blueprint/actions/workflows/pr-checks.yml/badge.svg [security-badge]: https://github.com/Pymetheus/python-project-blueprint/actions/workflows/security.yml/badge.svg [ci-badge]: https://github.com/Pymetheus/python-project-blueprint/actions/workflows/ci.yml/badge.svg @@ -85,7 +85,7 @@ By establishing structure, tooling, and automation upfront, it reduces the need - Dependency vulnerability scanning with `Snyk` - **Automated CI/CD** - - `pre-commit` hooks for local enforcement + - `prek` hooks for faster local enforcement - Workflows with fast dependency resolution using `uv` - Pull request gatekeeping workflows - CI verification and packaging @@ -139,7 +139,7 @@ pip install -e ".[dev]" Set up local git hooks for formatting, linting, and security checks: ```bash -pre-commit install +prek install ``` > **Note:** *Git must be installed, and you must be inside the cloned Git repository.* diff --git a/docs/CHECKLIST.md b/docs/CHECKLIST.md index c3a3b16..080cba4 100644 --- a/docs/CHECKLIST.md +++ b/docs/CHECKLIST.md @@ -59,7 +59,7 @@ install your project using the package manager of your choice: - `pip install -e ".[dev]"`. - `uv pip install -e ".[dev]"`. - `poetry install --extras dev`. -- [ ] **USER:** Run `pre-commit install`. +- [ ] **USER:** Run `prek install`. - [ ] **USER:** Run the application `python -m .main`. > **Note:** *Git must be installed, and you must be inside the cloned Git repository.* diff --git a/docs/INSTRUCTIONS.md b/docs/INSTRUCTIONS.md index d627c7a..99cde82 100644 --- a/docs/INSTRUCTIONS.md +++ b/docs/INSTRUCTIONS.md @@ -19,7 +19,7 @@ The **Python Project Blueprint** comes with built-in: | **Static Analysis** | `ruff` for linting/formatting and `mypy` for strict static type checking. | | **Automated Security** | `Snyk` (OSS) and `bandit` (SAST) integrated to scan for vulnerabilities and leaked secrets. | | **Standardized Governance** | Automated label synchronization, Issue templates, and Pull Request templates. | -| **Local Automation** | `.pre-commit-config.yaml` for linting, formatting, and security checks. | +| **Local Automation** | `.pre-commit-config.yaml` for linting, formatting, and security checks with `prek`. | | **CI/CD Pipeline** | `pr-checks`, `ci`, `cd`, and `security` GitHub Actions workflows. | | **Instant Bootstrapping** | A `bootstrap.yml` GitHub Action to rebrand and initialize the repository in seconds. | @@ -110,7 +110,7 @@ python-project-blueprint/ │ └── test_main.py ├── .dockerignore # Docker build exclusions ├── .gitignore # Git exclusions -├── .pre-commit-config.yaml # Local linting/security gates +├── .pre-commit-config.yaml # Local linting/security gates with prek ├── codecov.yml # Codecov configuration file ├── LICENSE.md # Usage permissions ├── pyproject.toml # Central configuration hub (Dependencies & Tools) @@ -186,7 +186,7 @@ The logger (configured in `src/package_name/utils/logger.py`) includes several p --- ## GitHub Actions & Automation -This project leverages GitHub Actions and pre-commit hooks to automate the entire development lifecycle, ensuring that high standards are maintained by default. +This project leverages GitHub Actions and prek hooks to automate the entire development lifecycle, ensuring that high standards are maintained by default. It houses the governance documents (templates) and the CI/CD pipelines (workflows) that enforce code quality, security, and release standards automatically. By using these tools, the project ensures that every contribution is vetted before it touches the `main` branch. @@ -224,7 +224,7 @@ Where applicable, CI/CD workflows use `uv` for dependency installation and resol --- -#### Pre-commit Workflow +#### Prek Workflow The first line of defense for code quality. By running checks locally before every commit, we eliminate "fix style" commits and ensure a clean history. diff --git a/pyproject.toml b/pyproject.toml index f8f6f8e..b5172e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dev = [ "pytest>=9.0.0", # Testing framework "pytest-cov>=7.0.0", # Coverage plugin for pytest "ruff>=0.14.7", # Code formatter, Linter, Import sorter - "pre-commit>=4.5.0", # Pre-commit hooks + "prek>=0.3.1", # Pre-commit hooks "mypy>=1.19.0", # Type checker "python-dotenv>=1.2.1", # Managing environment variables "bandit[toml]>=1.7.6", # Bandit security linter with toml support