Emit a diagnostic if a display name string is empty#1256
Conversation
Fixes rdar://157603034
|
@swift-ci please test |
|
@swift-ci please test Linux |
1 similar comment
|
@swift-ci please test Linux |
|
Should we give it a fix-it to remove the display name? Also, have you read the compiler diagnostic style guide? It might help you find the right voice for the message. |
|
@swift-ci please test |
|
@swift-ci please test Linux |
Added a fix-it to remove the display name argument!
I've now read the guide. Among its recommendations I saw:
Based on that, I feel like the severity of this should be a warning and not an error. In terms of the phrasing of the diagnostic message I'm still open to suggestions. I didn't see much in the style guide that would contradict my current phrasing but I could also imagine saying "Display name string is empty" rather than saying it "should not" be empty. |
|
@swift-ci test |
|
@swift-ci test |
|
@swift-ci test Windows |
|
@swift-ci test |
|
@swift-ci test |
No functional change: just adds new test cases for the change in swiftlang#1256 * Moved the tests previously added to `apiMisuseErrors` -> `apiMisuseErrorsIncludingFixIts`, and include the expected fixits It would probably be ok to leave them in `apiMisuseErrors` as well, but I think it would be kinda redundant since we also test the expected message along with the fixits already.
No functional change: adds new test cases for the change in #1256 Moved the tests previously added to `apiMisuseErrors` -> `apiMisuseErrorsIncludingFixIts`, and include the expected fixits It would probably be ok to leave them in `apiMisuseErrors` as well, but I think it would be kinda redundant since we also test the expected message along with the fixits already. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
This introduces an error diagnostic emitted from the testing library's
@Testand@Suitemacros if the display name string literal is empty. For example:Fixes rdar://157603034
Motivation:
It's not recommended for the display name string to be empty since it can cause confusing test results.
Checklist: