This repository sets the policies for developer environment in repositories if the ComPWA organization (See our Help developing page). The policies are automatically enforced through pre-commit.
Add a .pre-commit-config.yaml file to your repository with the following content:
repos:
- repo: https://github.com/ComPWA/policy
rev: ""
hooks:
- id: check-dev-filesthen run
pre-commit autoupdate --repo=https://github.com/ComPWA/policyThe notebook formatting hooks that used to live here have moved to ComPWA/nbhooks. When a repository contains notebooks, check-dev-files automatically migrates them over and keeps them up to date.
Important
After upgrading, the check-dev-files hook fails if your .pre-commit-config.yaml still passes area-scoped flags (such as --no-pypi) under args:. These options now live in a [tool.compwa.policy] table in your pyproject.toml. Run the following one-off command to migrate automatically; you do not need to install anything first.
uvx --from git+https://github.com/ComPWA/policy --refresh policy migrateThe same checks are exposed through a short Typer-based policy command, so you can run them on the fly without setting up pre-commit first:
uvx --from git+https://github.com/ComPWA/policy policy --helpRunning policy without a subcommand runs every check at once, exactly like the check-dev-files hook. Subcommands group the checks by domain, so you can run just a subset (e.g. policy python or policy nb). Options that apply to the whole repository can be declared once in a [tool.compwa.policy] table in your pyproject.toml instead of repeating them under args:. See the check-dev-files documentation for the full command tree and configuration options.