mistercrunch opened a new pull request, #34275:
URL: https://github.com/apache/superset/pull/34275
## Summary
Fixes pre-commit type checking hook that was incorrectly showing "Passed"
even when type errors existed.
## Problem
The `type-checking-frontend` pre-commit hook from PR #32261 had a critical
bug:
- Showed "Passed" even with clear TypeScript errors
- Broken `bash -c` wrapper wasn't propagating exit codes properly
## Solution
**Fixed pre-commit integration:**
- Removed problematic `bash -c` wrapper
- Hook now correctly fails on type errors
**Added smart fallback strategy:**
- ≤20 files: Targeted type checking on changed files
- \>20 files: Full project check with `--incremental` caching
- File batching (groups of 10) to avoid command line limits
## Testing
```bash
# With type error - now correctly fails ❌
echo 'const x: number = "string";' >> file.ts
pre-commit run type-checking-frontend --files file.ts
# Without errors - correctly passes ✅
git checkout file.ts
pre-commit run type-checking-frontend --files file.ts
Related
- Fixes issues from PR #32261 "feat(type-checking): Add type-checking
pre-commit hooks"
- Follows up PR #32323 "ci(type-checking): run type-checking-frontend hook
sequentially"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]