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

Added [Constant] attribute. #687

Merged
merged 10 commits into from
Feb 1, 2021
Merged

Added [Constant] attribute. #687

merged 10 commits into from
Feb 1, 2021

Conversation

TimothyJCowen
Copy link
Contributor

Can be used to fix #518

  • Added D2L.CodeStyle.Annotations.Contract.ConstantAttribute.cs
  • Added D2L.CodeStyle.Analyzers.Helpers.ConstantAnalyzer.cs
  • Added D2L.CodeStyle.Analyzers.Tests.Specs.ConstantAnalyzer.cs
  • Moved common method from Analyzers.ApiUsage.NotNullAnalyzer.cs to Analyzers.ExtensionMethods.cs
    • Changed to extension method on ISymbol

@omsmith

This comment has been minimized.

@TimothyJCowen

This comment has been minimized.

@omsmith
Copy link
Contributor

omsmith commented Jan 4, 2021

Also dunno if @j3parker still has reservations of this approach vs just doing it specifically for logging? Only know what was in that initial slack thread before the break.

j3parker
j3parker previously approved these changes Jan 11, 2021
Copy link
Member

@j3parker j3parker left a comment

Choose a reason for hiding this comment

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

Left some notes -- looks good!

TimothyJCowen and others added 3 commits January 27, 2021 10:19
Can be used to fix #518

- Added D2L.CodeStyle.Annotations.Contract.ConstantAttribute.cs
- Added D2L.CodeStyle.Analyzers.Helpers.ConstantAnalyzer.cs
- Added D2L.CodeStyle.Analyzers.Tests.Specs.ConstantAnalyzer.cs
- Moved common method from Analyzers.ApiUsage.NotNullAnalyzer.cs to Analyzers.ExtensionMethods.cs
  - Changed to extension method on ISymbol
Added tests to check specific logging cases.
…ctly.

Added more explanatory comments.
Changed HasAttribute() to compare symbols instead of strings.

Closes #697
omsmith
omsmith previously approved these changes Feb 1, 2021
j3parker
j3parker previously approved these changes Feb 1, 2021
Copy link
Member

@j3parker j3parker left a comment

Choose a reason for hiding this comment

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

Nice!

Co-authored-by: Jacob Parker <jacob@solidangle.ca>
@TimothyJCowen TimothyJCowen dismissed stale reviews from j3parker and omsmith via e76d8a3 February 1, 2021 19:07
@TimothyJCowen TimothyJCowen merged commit 81512cd into master Feb 1, 2021
@TimothyJCowen TimothyJCowen deleted the TJ-LogConstants branch February 1, 2021 19:08
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.

Require log messages are constant strings
3 participants