Skip to content

Discuss which checks and tests belong in pre-commit hooks #995

Open

Description

@coderabbitai

Summary

Agree as a group on which checks and tests should run in pre-commit hooks, and which should run only through explicit developer commands or CI.

Requested by @knoepfel during review of PR #975. This discussion is a follow-up and must not block that PR.

Context

The existing scripts-unit-tests hook in .pre-commit-config.yaml runs pytest scripts/test/ -v in a pre-commit-managed Python environment. PR #975 broadens its file scope to scripts/, ci/, and .devcontainer/, and removes the Python-only file filter.

The review raised a policy question about running pytest during commits. The hook provides automatic local checks without requiring developers to select an environment and invoke pytest manually, but the group should agree on the appropriate scope and cost of commit-time checks.

Discussion topics

  • Which formatting, linting, static analysis, and test checks should run before each commit?
  • Should pytest run in pre-commit, and if so, which tests and file triggers should apply?
  • What runtime and environment requirements are acceptable for local hooks?
  • Which checks should remain in CI or run through explicit developer commands?

Desired outcomes

  • Agree on the checks and tests that belong in pre-commit.
  • Define the scope and triggers for any commit-time tests.
  • Document the agreed policy and how developers run checks outside pre-commit.
  • Identify any follow-up changes to .pre-commit-config.yaml, test commands, or CI workflows.

References

Activity

  1. pcanal commented on Oct 20, 2026

    @pcanal
    Contributor

    The test commented upon on https://github.com/Framework-R-D/phlex/pull/975/changes/BASE..301d05655a575af577a91b75cfe821181cbc435c#r4314426250 really seems to build to the build/ctest step rather than the (pre)commit step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionWhat choice should we make

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions