Skip to content

Fix error baselines for empty files #1014

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 1 commit into from
Jun 2, 2025

Conversation

jakebailey
Copy link
Member

The old code said:

        const dupeCase = new Map<string, number>();
        for (const inputFile of inputFiles.filter(f => f.content !== undefined)) {
            // Filter down to the errors in the file

Except, content is string and could never be undefined; tests in Strada pass without the filter!

The ported code instead did a length check, which threw away files that should have been baselined. Just remove that filter.

For https://github.com/microsoft/typescript-go/pull/1013/files/35b83e8d784ce2679e1b377dd80dab9f412f3d97#r2121715758

@jakebailey jakebailey requested review from sandersn and Copilot June 2, 2025 17:51
@jakebailey jakebailey mentioned this pull request Jun 2, 2025
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 error baseline generation by removing an unnecessary filter that skipped files with empty content.

  • Removed filtering of input files based on content length in error_baseline.go.
  • Updated baseline error files to reflect the expected output without the filter.

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

File Description
internal/testutil/tsbaseline/error_baseline.go Removed the non-empty file filter to process all input files, including those with empty content.
testdata/baselines/reference/* Updated baseline files to match the new error baseline outputs.

@jakebailey jakebailey added this pull request to the merge queue Jun 2, 2025
Merged via the queue into main with commit 1607c83 Jun 2, 2025
23 checks passed
@jakebailey jakebailey deleted the jabaile/fix-empty-file-baselines branch June 2, 2025 18:35
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.

2 participants