Skip to content

ComPWA/policy

Repository files navigation

ComPWA repository policy

BSD 3-Clause license Spelling checked CI pre-commit.ci status code style: prettier uv Ruff ty

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.

Usage

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-files

then run

pre-commit autoupdate --repo=https://github.com/ComPWA/policy

The 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 migrate

Command-line interface

The 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 --help

Running 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.

About

Pre-commit hooks that ensure that ComPWA repositories have a similar developer set-up

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages