Skip to content

Deduplicate formatter test fixtures to unblock PR linting - #33

Merged
geoffreywiseman merged 12 commits into
mainfrom
copilot/add-support-for-totals
Mar 7, 2026
Merged

geoffreywiseman merged 12 commits into
mainfrom
copilot/add-support-for-totals

Conversation

Copilot AI commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

The PR was failing on duplicated test setup in the formatter tests. This change extracts the shared multi-repository usage fixture so both formatter suites reuse the same data shape without repeating the same construction logic.

  • Problem

    • human_formatter_test.go and tsv_formatter_test.go each inlined the same multi-repository fixture
    • golangci-lint flagged the overlap via dupl
  • Change

    • Add a shared test helper in format/formatter_test.go
    • Replace duplicated fixture construction in:
      • format/human_formatter_test.go
      • format/tsv_formatter_test.go
  • Scope

    • Test-only refactor
    • No formatter behavior or assertions changed
func sampleMultipleRepositoriesUsage() client.RepoUsage {
	return client.RepoUsage{
		firstRepo: {
			release: 1500,
			ci:      500,
		},
		secondRepo: {
			ci: 1000,
		},
		thirdRepo: {},
	}
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Display Totals</issue_title>
<issue_description>Read the basics for the GitHub CLI extension in the README.md, test it on a known org like codiform and then make a plan to support totals:

  • Total for all targets
  • Total by owner

You'll want to consider that there's more than one formatter. Any additions should come with tests.</issue_description>

<agent_instructions>Make sure you can run the extension to understand the current structure and test modifications. Use solid practices for Go software engineering.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits March 6, 2026 23:06
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for displaying totals in GitHub CLI extension Add owner and grand totals to human and TSV usage output Mar 6, 2026
Copilot AI and others added 2 commits March 7, 2026 00:32
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Copilot AI changed the title Add owner and grand totals to human and TSV usage output Add aggregate totals to human and TSV output Mar 7, 2026
Copilot AI and others added 2 commits March 7, 2026 00:48
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Copilot AI changed the title Add aggregate totals to human and TSV output Keep aggregate totals in human output only and restore module metadata Mar 7, 2026
@geoffreywiseman
geoffreywiseman marked this pull request as ready for review March 7, 2026 01:30
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Mar 7, 2026
@dosubot dosubot Bot added the enhancement New feature or request label Mar 7, 2026
Copilot AI and others added 2 commits March 7, 2026 01:38
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Copilot AI changed the title Keep aggregate totals in human output only and restore module metadata Keep aggregation in formatting, remove TSV totals, and restore module metadata Mar 7, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 7, 2026
Co-authored-by: geoffreywiseman <49935+geoffreywiseman@users.noreply.github.com>
Copilot AI changed the title Keep aggregation in formatting, remove TSV totals, and restore module metadata Deduplicate formatter test fixtures to unblock PR linting Mar 7, 2026
@geoffreywiseman
geoffreywiseman merged commit 4317222 into main Mar 7, 2026
14 checks passed
@geoffreywiseman
geoffreywiseman deleted the copilot/add-support-for-totals branch March 7, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display Totals

2 participants