Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/actions/basic-checks/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ runs:
shell: bash
run: npm run build:cli

- name: Typecheck CLI + tests (strict)
# Explicit gate independent of the prek tsc-cli hook's file-pattern filter.
# The hook's `files:` scope excludes test/ and src/, which let #2130 +
# #2422 interact to ship a strict-mode regression onto main silently.
# Running this unconditionally here catches that class of drift.
shell: bash
run: npm run typecheck:cli

- name: Validate config schemas
shell: bash
run: npm run validate:configs
Expand Down
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ repos:
entry: npx tsc -p tsconfig.cli.json
language: system
pass_filenames: false
files: ^(bin|scripts)/
# Match what tsconfig.cli.json actually typechecks — previously ^(bin|scripts)/
# missed test-only and src-only PRs, which allowed a strict-mode regression
# (#2130 × #2422) to land on main silently.
files: ^(bin/|scripts/|src/|test/|tsconfig.*\.json$)
types_or: [ts, tsx]
Comment on lines +245 to 246

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

In pre-commit/prek hook matching, when both filesandtypes_or are set, must a changed file satisfy both filters to trigger the hook?

💡 Result:

Yes, a changed file must satisfy both the files filter (if specified) and the types_or filter to trigger the hook. All top-level filters (files, types, types_or, exclude_types) are combined with AND logic after the initial files/exclude regex filtering.

Citations:


Remove types_or filter or restructure to include tsconfig.*.json files.

The files pattern includes tsconfig.*\.json on Line 245, but types_or: [ts, tsx] on Line 246 prevents JSON files from triggering the hook. Pre-commit applies both filters with AND logic, so a file must match both patterns; since tsconfig.*.json has type json, not ts/tsx, changes to config files skip this hook.

Suggested fix
-        files: ^(bin/|scripts/|src/|test/|tsconfig.*\.json$)
-        types_or: [ts, tsx]
+        files: ^((bin|scripts|src|test)/.*\.(ts|tsx)$|tsconfig.*\.json$)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
files: ^(bin/|scripts/|src/|test/|tsconfig.*\.json$)
types_or: [ts, tsx]
files: ^((bin|scripts|src|test)/.*\.(ts|tsx)$|tsconfig.*\.json$)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 245 - 246, The pre-commit hook
currently uses both the files pattern and the types_or filter so
tsconfig.*\.json (matched by the files regex) never triggers because types_or:
[ts, tsx] restricts to TypeScript file types; update the .pre-commit-config.yaml
by either removing the types_or key entirely from this hook or
expanding/restructuring it so JSON config files are included (for example add
"json" to types_or or separate the tsconfig.*\.json pattern into its own hook
entry), ensuring the "files" regex for tsconfig.*\.json and the types_or setting
no longer block each other.

stages: [pre-push]
priority: 10
Expand Down
Loading