Skip to content

Add hereby diff task#2915

Merged
weswigham merged 1 commit intomicrosoft:mainfrom
weswigham:hereby-diff
Feb 26, 2026
Merged

Add hereby diff task#2915
weswigham merged 1 commit intomicrosoft:mainfrom
weswigham:hereby-diff

Conversation

@weswigham
Copy link
Member

I was setting up a new environment and realized this was missing, and I'd been relying on saved paths in my difftool to do diffs.

Copilot AI review requested due to automatic review settings February 26, 2026 18:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new hereby diff task to streamline the workflow for comparing baseline test results. The task allows developers to use their preferred external diff tool (specified via the DIFF environment variable) to visually compare reference baselines against locally generated baselines.

Changes:

  • Added a getDiffTool() helper function to retrieve and validate the DIFF environment variable
  • Added a diff task that invokes the external diff tool with reference and local baseline directories

function getDiffTool() {
const program = process.env.DIFF;
if (!program) {
console.warn("Add the 'DIFF' environment variable to the path of the program you want to use.");
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is unclear and grammatically awkward. It should directly state what the user needs to do. Consider rephrasing to: "DIFF environment variable is not set. Set it to the path of your preferred diff tool (e.g., 'export DIFF=meld')."

Suggested change
console.warn("Add the 'DIFF' environment variable to the path of the program you want to use.");
console.warn("DIFF environment variable is not set. Set it to the path of your preferred diff tool (e.g., 'export DIFF=meld').");

Copilot uses AI. Check for mistakes.
function getDiffTool() {
const program = process.env.DIFF;
if (!program) {
console.warn("Add the 'DIFF' environment variable to the path of the program you want to use.");
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using console.warn followed by process.exit(1) is inconsistent with error handling patterns in the codebase. For fatal errors, either throw an Error (like assertTypeScriptCloned at line 148) or use console.error. Since this is a fatal error that exits the process, it should use console.error instead of console.warn.

Suggested change
console.warn("Add the 'DIFF' environment variable to the path of the program you want to use.");
console.error("Add the 'DIFF' environment variable to the path of the program you want to use.");

Copilot uses AI. Check for mistakes.
@weswigham weswigham added this pull request to the merge queue Feb 26, 2026
Merged via the queue into microsoft:main with commit 1d35e57 Feb 26, 2026
25 checks passed
@weswigham weswigham deleted the hereby-diff branch February 26, 2026 22:00
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.

3 participants