-
Notifications
You must be signed in to change notification settings - Fork 655
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
Conversation
There was a problem hiding this 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 ( |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Fixes #304