From 28d8a58d9a6a6d63736e573770bf1318487471dc Mon Sep 17 00:00:00 2001 From: Stephen Aylward Date: Fri, 24 Jul 2026 15:29:42 -0400 Subject: [PATCH] ENH: Apply pre-commit checks only to tracked files --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95a2b3c..d8c1c4f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,14 +17,14 @@ repos: rev: v2.1.0 hooks: - id: mypy - # With pass_filenames: false, we must provide an explicit target for mypy. - # Otherwise mypy exits with: "Missing target module, package, files, or command." - args: [--config-file=pyproject.toml, src, tutorials] + # Pass only the staged files pre-commit selects (via the files regex); + # do not scan whole src/ and tutorials/ trees, which would include + # untracked files. + args: [--config-file=pyproject.toml] additional_dependencies: - types-setuptools - scipy-stubs - types-requests - pass_filenames: false files: ^(src/|tutorials/) # Regenerate docs/API_MAP.md whenever Python source files change