fix(first): keep code parsable after the autofix with decorators and no semicolons #600
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 244 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #600"
general
weight: 0.35
thekhegay
Autofix of
firstcan leave code that doesn't parse, seen on 4.18.0Decorated
export classas first statment. Range ofexportstarts after decorators, so import is put between decorator andexport:Import without semicolon on line of other statement keeps that line, and without
;only line break ends it:Same with
import b from 'b'above andfoo(); import a from 'a';below, moved import is glued afterbAnd when legal import shares line with code, like
import b from 'b'; foo(), moved import without;lands right beforefoo()on that lineNow insert goes before decorators, moved import gets its own line when code it follows has no
;, and line break after it when code folows on same line. Imports with semicolons on one line stay as before, existing cases are not changedFuzz over 1425 generated files: 148 broken outputs on master, 10 with this, no output changed where master was fine. Those 10 are other case wich I didn't touch here: import with code after it on its line, like
import a from 'a'; bar()underfoo(), removal still gluesfoo() bar()<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Fixed an autofix issue that could produce unparseable code when moving imports around decorated class declarations or imports without semicolons.
Improved import placement and line-break preservation when multiple imports share a line.
Import movement now preserves valid ordering around exported and default-exported decorated classes, including when statements are separated by semicolons or line breaks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->