Skip to content

Say "1 entry" in the notch report text output (ALI-2672) - #19

Draft
michaelaguiar wants to merge 1 commit into
mainfrom
aliasbot/ali-2672-notch-report-text-output-says-1-entries
Draft

michaelaguiar wants to merge 1 commit into
mainfrom
aliasbot/ali-2672-notch-report-text-output-says-1-entries

Conversation

@michaelaguiar

Copy link
Copy Markdown
Member

Fixes ALI-2672

What

notch report text output always wrote "entries" on the hours and unbilled lines, so one entry printed as "1 entries". Both lines now use the CLI's existing plural() helper (the one the clients and projects delete prompts use), which follows the same rule as the TUI: "1 entry", "2 entries".

-json and --csv output are unchanged.

Testing

  • New TestReport_TextPluralisesEntries runs the report over a one-entry day and a two-entry day and checks both lines. It fails on main with unbilled $170.00 1 entries.
  • gofmt -l ., go vet ./..., go run ./design/build -check pass.
  • go test ./...: everything passes except internal/ui TestClientsLayout_140, which also fails on main today. Its sample data is dated a few days back from now, so early in the month some entries fall into the previous month and the "this month" columns change. This PR doesn't touch internal/ui.

Not in this PR

notch edit and notch delete bulk messages in main.go ("updated %d entries", "deleted %d entries") have the same wording issue for one entry. They are outside this ticket.

The hours and unbilled lines always wrote "entries". Use the CLI's
plural helper, as the catalog commands do, and test 1 and 2 entries.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant