Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Write CA1824 as non-compilation-end#6873

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mavasani merged 2 commits intodotnet:mainfromYoussef1313:Ca1824-no-comp-end
Oct 11, 2023

Conversation

@Youssef1313
Copy link
Member

The intent of this change is two things:

  1. Avoid analyzing more attributes if we already found a matching attribute.
  2. Having this analyzer not be a compilation end analyzer.

@mavasani@sharwell Do you think it's worth changing this analyzer to not be non-compilation-end (which will make it available in IDE live diagnostics)?

Is there a better than what I did here?

@Youssef1313Youssef1313 marked this pull request as ready for reviewAugust 20, 2023 09:52
@Youssef1313Youssef1313 requested a review froma team as acode ownerAugust 20, 2023 09:52
@codecov
Copy link

codecovbot commentedAug 20, 2023

Codecov Report

Merging#6873 (2073e40) intomain (3587540) willincrease coverage by0.00%.
The diff coverage is98.11%.

Additional details and impacted files
@@           Coverage Diff           @@##             main    #6873   +/-   ##=======================================  Coverage   96.39%   96.39%           =======================================  Files        1403     1403             Lines      330977   331006   +29       Branches    10890    10892    +2     =======================================+ Hits       319055   319085   +30+ Misses       9188     9187    -1  Partials     2734     2734

data.ApplicationSyntaxReference?.GetSyntax(context.CancellationToken)is{}attributeSyntax)
{
// we have the attribute but its doing it wrong.
context.ReportDiagnostic(attributeSyntax.CreateDiagnostic(Rule));
Copy link

@sharwellsharwellAug 22, 2023
edited
Loading

Choose a reason for hiding this comment

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

❗ This diagnostic (the one with a specific location) shouldalways be reported.It can setalreadyReportedDiagnostic to true, but it should not return without reporting ifalreadyReportedDiagnostic was already true.

Edit: It cannot setalreadyReportedDiagnostic to true because it would destabilize the no-location reporting.

Choose a reason for hiding this comment

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

Diagnostic with location will always be reported if we find a source assembly attribute here, otherwise a no-location diagnostic will always be reported - I believe the logic here is deterministic becausedata is computed at CompilationStart and does not alter during subsequent callbacks.

@mavasani
Copy link

@sharwell I can merge once you are happy with the PR, thanks!

@mavasani
Copy link

Merging this PR - feel free to create a follow-up PR for any follow-up changes.

@mavasanimavasani merged commit35bb41b intodotnet:mainOct 11, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@sharwellsharwellsharwell left review comments

@mavasanimavasanimavasani approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Youssef1313@mavasani@sharwell

[8]ページ先頭

©2009-2025 Movatter.jp