check-dev-files

check-dev-files#

This hook is responsible for standardizing and synchronizing the developer environment of repositories by the ComPWA organization. Coding conventions are enforced through automated checks instead of through a contribution guide. These conventions have to be regularly updated across all repositories as developer tools introduce new features and deprecate old ones.

The check-dev-files hook can also be used as a cookie cutter for new repositories by adding the following to your .pre-commit-config.yaml file:

repos:
  - repo: https://github.com/ComPWA/policy
    rev: ""
    hooks:
      - id: check-dev-files
        args:
          - --repo-name="short name for your repository"

and running

pre-commit autoupdate --repo=https://github.com/ComPWA/policy
pre-commit run check-dev-files -a

For more implementation details of this hook, check the check_dev_files module.

Hook arguments#

The check-dev-files hook can be configured with by adding any of the following flags to the args key in your .pre-commit-config.yaml file.

usage: check-dev-files [-h] [--allow-deprecated-workflows]
                       [--allowed-cell-metadata ALLOWED_CELL_METADATA]
                       [--ci-skipped-tests CI_SKIPPED_TESTS]
                       [--ci-test-extras CI_TEST_EXTRAS]
                       [--dependabot {keep,update}]
                       [--doc-apt-packages DOC_APT_PACKAGES] [--github-pages]
                       [--gitpod] [--keep-issue-templates] [--keep-pr-linting]
                       [--outsource-pixi-to-tox] [--no-cspell-update]
                       [--no-github-actions] [--no-python] [--no-prettierrc]
                       [--allow-labels]
                       [--dev-python-version DEV_PYTHON_VERSION] [--no-macos]
                       [--no-notebooks] [--no-pypi] [--no-ruff]
                       [--no-version-branches]
                       [--package-managers PACKAGE_MANAGERS]
                       [--pin-requirements {no,biweekly,monthly,bimonthly,quarterly,biannually,outsource}]
                       [--pytest-single-threaded] --repo-name REPO_NAME
                       [--repo-organization REPO_ORGANIZATION]
                       [--repo-title REPO_TITLE]

Named Arguments#

--allow-deprecated-workflows

Allow deprecated CI workflows, such as ci-docs.yml.

Default: False

--allowed-cell-metadata

Comma-separated list of allowed metadata in Jupyter notebook cells, e.g. editable,slideshow.

Default: “”

--ci-skipped-tests

Avoid running CI test on the following Python versions

Default: “”

--ci-test-extras

Comma-separated list of extras that are required for running tests on CI

Default: “”

--dependabot

Possible choices: keep, update

Leave dependabot.yml untouched (‘keep’) or sync with ComPWA/policy

--doc-apt-packages

Comma- or space-separated list of APT packages that are required to build documentation

Default: “”

--github-pages

Host documentation on GitHub Pages

Default: False

--gitpod

Create a GitPod config file

Default: False

--keep-issue-templates

Do not remove the .github/ISSUE_TEMPLATE directory

Default: False

--keep-pr-linting

Do not overwrite the PR linting workflow

Default: False

--outsource-pixi-to-tox

Run

Default: False

--no-cspell-update

Do not enforce same cSpell configuration as other ComPWA repositories. This can be useful if you have a more advanced configuration, like using different dictionaries for different file types.

Default: False

--no-github-actions

Do not add standard GitHub Actions workflows that are used across ComPWA repositories. This can be useful if you already have your own CI workflows that do the same as the workflows enforced by the check-dev-files hook.

Default: False

--no-python

Skip check that concern config files for Python projects.

Default: False

--no-prettierrc

Remove the prettierrc, so that Prettier’s default values are used.

Default: False

--allow-labels

Do not perform the check on labels.toml

Default: False

--dev-python-version

Specify the Python version for your developer environment

Default: “3.9”

--no-macos

Do not run test job on macOS

Default: False

--no-notebooks

This repository does not contain Jupyter notebooks

Default: False

--no-pypi

Do not publish package to PyPI

Default: False

--no-ruff

Do not enforce Ruff as a linter

Default: False

--no-version-branches

Do not push to matching major/minor version branches upon tagging

Default: False

--package-managers

Specify which package managers to use for the project as a comma-separated list. Possible options: conda, pixi, uv, venv

Default: “conda, pixi, uv, venv”

--pin-requirements

Possible choices: no, biweekly, monthly, bimonthly, quarterly, biannually, outsource

Add a script to pin developer requirements to a constraint file. Argument is the frequency of the cron job

Default: “no”

--pytest-single-threaded

Run pytest without the -n argument

Default: False

--repo-name

Name of the repository. This can usually be found in the URL of the repository on GitHub or GitLab

--repo-organization

Name of the organization under which the repository lives.

Default: “ComPWA”

--repo-title

Title or full name of the repository. If not provided, this falls back to the repo-name.

Default: “”