FutureFeature enum - #8185
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughA shared ChangesFutureFeature parsing and preprocessing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/codegen/src/compile.rs (1)
204-287: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
FutureFeatureinpreprocess.rsas well.
crates/codegen/src/preprocess.rs:196-258still hardcodes the same__future__names. Keeping two independent lists means the precheck and codegen paths can drift the next time a feature is added or renamed. Consider moving that path to the enum too so there is a single source of truth.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/codegen/src/compile.rs` around lines 204 - 287, `FutureFeature` is now the single source of truth for `__future__` names, but `preprocess.rs` still maintains a separate hardcoded list. Update the `preprocess` path to use `FutureFeature::try_from` (or otherwise reference `FutureFeature` directly) instead of duplicating the feature names, so both preprocessing and codegen stay aligned when `FutureFeature` changes. Keep the existing behavior in the preprocessing logic, but route name validation/matching through the enum and its variants rather than a second list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/codegen/src/compile.rs`:
- Around line 204-287: `FutureFeature` is now the single source of truth for
`__future__` names, but `preprocess.rs` still maintains a separate hardcoded
list. Update the `preprocess` path to use `FutureFeature::try_from` (or
otherwise reference `FutureFeature` directly) instead of duplicating the feature
names, so both preprocessing and codegen stay aligned when `FutureFeature`
changes. Keep the existing behavior in the preprocessing logic, but route name
validation/matching through the enum and its variants rather than a second list.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 86ae9578-dc47-408c-b911-5ebf302e01d2
📒 Files selected for processing (1)
crates/codegen/src/compile.rs
b7bcf43 to
a97f0fe
Compare
Summary
Summary by CodeRabbit
from __future__ import ...by reliably recognizing supported feature names.braces) and ensured previously-supported flags continue to behave the same.