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

Review diagnostic messages for missing single quotes around symbol names #3183

Closed
wants to merge 3 commits into from

Conversation

Evangelink
Copy link
Member

Fix #1714

I did a first review of all the diagnostic messages to find missing quotes. I have deliberately skipped all description messages (let me know if you want me to update them).

I have, for now, only changed the resource files and when we agree upon the texts I'll update the various translation files.

Doing this review of the messages, I have a couple of remarks to make:

  • There is no consistency on whether title and messages shall end (or not) with a period.

  • Some of the messages are using a pascal case rule for all the words of the message, this probably reads weird when we happen to have the issue raised.

  • There is no consistency on how attributes are referred to. We can find Use [XXX], Use [XXXAttribute], Add XXX attribute or Add XXXAttribute. It might be good to always use the same style.

@Evangelink Evangelink requested a review from a team as a code owner January 9, 2020 15:15
@mavasani
Copy link
Contributor

There is no consistency on whether title and messages shall end (or not) with a period.

@sharwell do we have any precedence on this?

@mavasani
Copy link
Contributor

mavasani commented Jan 10, 2020

There is no consistency on how attributes are referred to.

I'd say lets just choose one style and be consistent. I am fine with using Add 'XXXAttribute'.

@@ -154,13 +154,13 @@
<value>Don't Store Async Lambdas as Void Returning Delegate Types</value>
</data>
<data name="PropagateCancellationTokensWhenPossibleTitle" xml:space="preserve">
<value>Propagate CancellationTokens When Possible</value>
<value>Propagate 'CancellationTokens' When Possible</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<value>Propagate 'CancellationTokens' When Possible</value>
<value>Propagate 'CancellationToken' when possible</value>

Copy link
Member Author

Choose a reason for hiding this comment

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

That's one example of

Some of the messages are using a pascal case rule for all the words of the message

</data>
<data name="PropagateCancellationTokensWhenPossibleDescription" xml:space="preserve">
<value>#N/A</value>
</data>
<data name="PropagateCancellationTokensWhenPossibleMessage" xml:space="preserve">
<value>Propagate CancellationTokens When Possible</value>
<value>Propagate 'CancellationTokens' When Possible</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<value>Propagate 'CancellationTokens' When Possible</value>
<value>Propagate 'CancellationToken' when possible</value>

</data>
<data name="ApplyDiagnosticAnalyzerAttribute_1" xml:space="preserve">
<value>Apply DiagnosticAnalyzer attribute for '{0}'.</value>
<value>Apply 'DiagnosticAnalyzer' attribute for '{0}'.</value>
Copy link
Member

Choose a reason for hiding this comment

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

💭 Another option here is:

Suggested change
<value>Apply 'DiagnosticAnalyzer' attribute for '{0}'.</value>
<value>Apply [DiagnosticAnalyzer] for '{0}'.</value>

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking about this syntax first but then I thought that was too C# oriented (thinking about vb.net devs). Let me know if you still prefer to go for the brackets.

@sharwell
Copy link
Member

There is no consistency on whether title and messages shall end (or not) with a period.

My preference is:

  1. No '.' for single-sentence titles and messages (and avoid multi-sentence unless it substantially detracts from clarity)
  2. Use full sentences with '.' for descriptions

@sharwell
Copy link
Member

There is no consistency on how attributes are referred to.

My preference is 'SomeAttribute' for diagnostics, and [Some] for code fixes.

@Evangelink
Copy link
Member Author

I will create a ticket and list what was said in this PR, close this PR and open a new one with only the changes we agreed upon.

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.

Audit diagnostic messages for missing quotes around symbol names
3 participants