Skip to content
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

Use text blocks for more Error Prone test outputs #4575

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

copybara-service[bot]
Copy link
Contributor

Use text blocks for more Error Prone test outputs

I skipped reformatted these ones, because reformatting would cause some tests to fail, because of examples like

// BUG: Diagnostic contains
@Override void f() {}
// BUG: Diagnostic contains
@Override
void f() {} // <- the diagnostic is actually on this line

I skipped reformatted these ones, because reformatting would cause some tests to fail, because of examples like

```
// BUG: Diagnostic contains
@OverRide void f() {}
```

```
// BUG: Diagnostic contains
@OverRide
void f() {} // <- the diagnostic is actually on this line
```

PiperOrigin-RevId: 674341306
@copybara-service copybara-service bot merged commit 350815a into master Sep 13, 2024
@copybara-service copybara-service bot deleted the test_673944296 branch September 13, 2024 17:11
@rickie
Copy link
Contributor

rickie commented Sep 16, 2024

@cushon I'm curious how you did this 😄.

Did you write a check internally? Or did you by any chance use something from this PR PicnicSupermarket/error-prone-support#198?

@cushon
Copy link
Collaborator

cushon commented Sep 16, 2024

@cushon I'm curious how you did this 😄.

Did you write a check internally? Or did you by any chance use something from this PR PicnicSupermarket/error-prone-support#198?

@rickie I ended up creating a separate command-line tool that used javac's parser and heuristics to find APIs like this and migrate them for text blocks. The goal was to have something more general that could migrate other similar APIs, e.g. these ones in Bazel

I'd also like to have a way to keep these tests formatted, so your TestHelperSourceFormat seems like a good approach for that!

@rickie
Copy link
Contributor

rickie commented Sep 25, 2024

Thanks for the explanation @cushon .

I'd also like to have a way to keep these tests formatted, so your TestHelperSourceFormat seems like a good approach for that!

We aim to finish the improvements for the text blocks PR and thus the TestHelperSourceFormat in the coming weeks.

Would you be up for a PR here to upstream this check once we finished it?

One thing we would also like to fix (and probably put behind a flag) is to support this request from @msridhar PicnicSupermarket/error-prone-support#474.

@cushon
Copy link
Collaborator

cushon commented Sep 25, 2024

Would you be up for a PR here to upstream this check once we finished it?

That sounds great, I'd be happy to review a PR!

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