Conversation
…number formatting (GH-210, GH-211) - Add DependencyGraph.containsUnqualifiedCellReferences to distinguish qualified vs unqualified refs; eval with fully-qualified formulas (e.g. =SUM(Revenue!B2:B5)) no longer requires -s flag - Change style command output label from "(merge)" to "(additive)" and "(merge, streaming)" to "(additive, streaming)" - Rasterizers command now always returns ExitCode.Success - Fix NumFmtFormatter.formatGeneral to use toPlainString instead of toString, preventing scientific notation (e.g. 5.809440E-01) in cell command Formatted field Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review: PR #216This PR addresses four quality-of-life improvements in the CLI. Overall, the implementation is well-structured and thoughtful, with good attention to architectural consistency. Here's my detailed feedback: ✅ Strengths1. Smart Sheet Inference Logic (GH-210)The new
Key insight: The distinction between "needs a sheet" vs "has cell references" is architecturally correct—qualified formulas like 2. Number Formatting Fix (GH-211)The fix in 3. Clear Label Change"(merge)" → "(additive)" is much clearer for users—eliminates cell merge confusion. 4. Sensible Exit Code
|
|
🔍 Missing Test CoverageCritical Gap: No tests verify
Recommended Test Cases: // xl-evaluator/test/src/.../graph/DependencyGraphSuite.scala
test("containsUnqualifiedCellReferences - qualified only") {
val expr = parse("=SUM(Revenue!B2:B5)").toOption.get
assert(!DependencyGraph.containsUnqualifiedCellReferences(expr))
}
test("containsUnqualifiedCellReferences - mixed qualified/unqualified") {
val expr = parse("=A1 + Revenue!B2").toOption.get
assert(DependencyGraph.containsUnqualifiedCellReferences(expr))
}
test("containsUnqualifiedCellReferences - nested aggregates") {
val expr = parse("=SUM(A1:A10) + SUM(Data!B1:B10)").toOption.get
assert(DependencyGraph.containsUnqualifiedCellReferences(expr))
}
test("containsUnqualifiedCellReferences - constants only") {
val expr = parse("=10 + 20").toOption.get
assert(!DependencyGraph.containsUnqualifiedCellReferences(expr))
}These tests would validate the core logic and prevent regressions. |
🔒 Security & PerformanceNo Concerns Identified:
📋 Minor Observations
🎯 VerdictApprove with Recommendations:
Risk Assessment:
💡 Suggested Follow-UpIf refactoring in this PR risks delaying the merge, consider:
Great work on the fixes—especially the qualified formula inference and BigDecimal formatting! 🚀 |
Summary
DependencyGraph.containsUnqualifiedCellReferencessoevalwith fully-qualified formulas (e.g.,=SUM(Revenue!B2:B5)) no longer requires the-sflag. Qualified-only formulas use the first sheet as ambient context since the evaluator resolves cross-sheet refs by name."(merge)"→"(additive)"and"(merge, streaming)"→"(additive, streaming)"in style command output.rasterizerscommand now always returnsExitCode.Success(informational command, not a failure).NumFmtFormatter.formatGeneralto usen.underlying.stripTrailingZeros.toPlainStringinstead ofn.toString, preventing scientific notation (e.g.,5.809440E-01) in cell command Formatted field.Test plan
./mill xl-evaluator.test— 174/174 pass./mill xl-core.test— 127/127 pass./mill xl-cli.test— 317/317 pass./mill __.checkFormat— all passCloses #210
Closes #211
🤖 Generated with Claude Code