Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1680 +/- ##
=======================================
Coverage 91.64% 91.64%
=======================================
Files 96 96
Lines 18662 18662
=======================================
Hits 17102 17102
Misses 1560 1560 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the tag constant system in prek-identify to improve code clarity and performance by introducing a two-tier constant system: individual tag ID constants (TAG_*) as u16 values for use with the insert() method, and prebuilt TagSet constants (TAG_SET_*) for returns, comparisons, and assignments.
Changes:
- Introduced separate
TAG_*(u16) constants for individual tag IDs andTAG_SET_*(TagSet) constants for prebuilt tag sets - Updated the Python code generator (
gen.py) to produce both types of constants - Refactored all usage sites to use the appropriate constant type (
.insert()for individual tags, direct assignment/comparison for tag sets)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/prek-identify/gen.py |
Splits constant generation into TAG_ID_CONSTS (u16 IDs) and TAG_SET_CONSTS (TagSet objects) |
crates/prek-identify/src/tags.rs |
Generated file now includes both TAG_* (u16) and TAG_SET_* (TagSet) constants |
crates/prek-identify/src/lib.rs |
Updated tags_from_path to use TAG_* for .insert() calls and TAG_SET_* for returns and comparisons |
crates/prek/src/hook.rs |
Updated default types assignment to use TAG_SET_FILE and test to use TAG_SET_TEXT |
crates/prek/src/hooks/builtin_hooks/mod.rs |
Replaced all TagSet::from_tags() calls and old constants with new TAG_SET_* constants; removed unused TagSet import |
📦 Cargo Bloat ComparisonBinary size change: +0.00% (23.8 MiB → 23.8 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
No description provided.