Add log no-truncate flag#170
Conversation
📝 WalkthroughWalkthroughAdds a 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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)
internal/ui/update.go (1)
418-425: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant
dr.NumDaysassignment in the week branch.Line 418 sets
dr.NumDays = 7, but line 424 unconditionally overwrites it withm.dateRange.NumDays. This is harmless only as long asm.dateRange.NumDays == 7for the week period; the inner assignment is dead. The1*m.dateRange.NumDayson line 421 is also a redundant multiply. Consider dropping the inner assignment and the1*for clarity.♻️ Proposed cleanup
startOfNextWeek := m.dateRange.Start.AddDate(0, 0, 7-int(offset)) dr.Start = time.Date(startOfNextWeek.Year(), startOfNextWeek.Month(), startOfNextWeek.Day(), 0, 0, 0, 0, startOfNextWeek.Location()) - dr.NumDays = 7 default: - dr.Start = m.dateRange.Start.AddDate(0, 0, 1*m.dateRange.NumDays) + dr.Start = m.dateRange.Start.AddDate(0, 0, m.dateRange.NumDays) }🤖 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 `@internal/ui/update.go` around lines 418 - 425, The week-period branch in `internal/ui/update.go` has a redundant `dr.NumDays = 7` that is immediately overwritten by the later unconditional assignment, so remove the inner `dr.NumDays` setting from that branch and rely on the shared assignment after the switch. Also clean up the `default` case in the same `dateRange` handling logic by removing the unnecessary `1*` multiplication when advancing `m.dateRange.Start`; keep the behavior unchanged while simplifying the code around `dr` and `m.dateRange`.
🤖 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 `@internal/ui/update.go`:
- Around line 418-425: The week-period branch in `internal/ui/update.go` has a
redundant `dr.NumDays = 7` that is immediately overwritten by the later
unconditional assignment, so remove the inner `dr.NumDays` setting from that
branch and rely on the shared assignment after the switch. Also clean up the
`default` case in the same `dateRange` handling logic by removing the
unnecessary `1*` multiplication when advancing `m.dateRange.Start`; keep the
behavior unchanged while simplifying the code around `dr` and `m.dateRange`.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: db0a50b7-d44e-4ba1-8d53-0fc9e4ea4915
📒 Files selected for processing (10)
README.mdcmd/root.gointernal/ui/cmds.gointernal/ui/initial.gointernal/ui/log.gointernal/ui/log_test.gointernal/ui/model.gointernal/ui/report.gointernal/ui/stats.gointernal/ui/update.go
|
Thanks for sending in the PR :) |
Summary
--no-truncateflag to thelogcommand