Skip to content

Fix up relative path names in baseline header diffs #1035

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

jakebailey
Copy link
Member

Fixes #304

@jakebailey jakebailey requested review from sandersn and Copilot June 4, 2025 07:43
Copy link
Contributor

@Copilot 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 PR fixes the relative path names in baseline header diffs to ensure consistency in diff outputs. Key changes include:

  • Removal or adjustment of relative path prefixes within various baseline diff files.
  • Updates in internal test utility and compiler runner code to normalize paths by stripping the "./" prefix.
  • Consolidation of diff header formatting to support baseline header comparisons.

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

File Description
testdata/baselines/reference/submodule/compiler/*.diff Updated baseline diff files to adjust or remove relative path prefixes.
internal/testutil/tsbaseline/type_symbol_baseline.go Added logic to normalize relative paths for diff headers.
internal/testrunner/compiler_runner.go Introduced a DiffFixupOld function to unify diff header processing.

@@ -81,6 +81,14 @@ func DoTypeAndSymbolBaseline(
}
}

const (
Copy link
Preview

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

The diff fixup logic here is nearly identical to the one added in compiler_runner.go. Consider extracting this logic into a shared helper function to avoid duplication and simplify future maintenance.

Copilot uses AI. Check for mistakes.

@@ -344,6 +344,25 @@ func (c *compilerTest) verifyDiagnostics(t *testing.T, suiteName string, isSubmo
Subfolder: suiteName,
IsSubmodule: isSubmodule,
IsSubmoduleAccepted: c.containsUnsupportedOptions(),
DiffFixupOld: func(old string) string {
Copy link
Preview

Copilot AI Jun 4, 2025

Choose a reason for hiding this comment

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

This diff header normalization logic duplicates what is done in type_symbol_baseline.go. Consider refactoring the common functionality into a single utility function for improved consistency and maintainability.

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

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

This is fine for temp code like this.

@jakebailey jakebailey added this pull request to the merge queue Jun 4, 2025
Merged via the queue into main with commit ae5c275 Jun 4, 2025
23 checks passed
@jakebailey jakebailey deleted the jabaile/fix-relative-paths-diffs branch June 4, 2025 14:28
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.

runner: Strada baselines rarely put ./ on front of filename, but Corsa always removes it
2 participants