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

Don't emit CA1064 in executables #7234

Merged
merged 4 commits into from
Jun 24, 2024
Merged

Conversation

CollinAlpert
Copy link
Contributor

@CollinAlpert CollinAlpert commented Mar 7, 2024

Affected analyzers: MakeTypesInternal, ExceptionsShouldBePublicAnalyzer
Affected diagnostic IDs: CA1515, CA1064

This PR ensures that exception types are not suggested to be made internal, as this could conflict with CA1064.

Fixes #7191

@CollinAlpert CollinAlpert requested a review from a team as a code owner March 7, 2024 23:30
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 99.13345% with 5 lines in your changes missing coverage. Please review.

Project coverage is 96.49%. Comparing base (f1115ed) to head (0bd9027).

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #7234    +/-   ##
========================================
  Coverage   96.49%   96.49%            
========================================
  Files        1443     1443            
  Lines      345670   345799   +129     
  Branches    11370    11374     +4     
========================================
+ Hits       333552   333677   +125     
- Misses       9240     9241     +1     
- Partials     2878     2881     +3     

Copy link
Member

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

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

Thank you @CollinAlpert for the fix, as discussed in the issue we don't want to exclude exception types from CA1515, instead it's better to exclude diagnostic for CA1064 Exceptions should be public: in executable.

  • Please revert the Exclude exception types from CA1515 part from the PR, looks you also did some code refactoring for the analyzer we can accept that part.
  • If you are interested fixing the issue by excluding CA1064 diagnostics for executable, that will be great, but not required

@CollinAlpert
Copy link
Contributor Author

Thanks for the hint, I have reverted the change to CA1515 and tweaked CA1064.

@CollinAlpert CollinAlpert changed the title Exclude exception types from CA1515 Don't emit CA1064 in executables Jun 19, 2024
Copy link
Member

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

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

Left a few comments, overall looks great, thank you @CollinAlpert!

Copy link
Member

@buyaa-n buyaa-n left a comment

Choose a reason for hiding this comment

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

Thanks @CollinAlpert looks good

@buyaa-n buyaa-n merged commit 43709af into dotnet:main Jun 24, 2024
11 checks passed
@CollinAlpert CollinAlpert deleted the issue-7191 branch June 24, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflict between CA1515 and CA1064 for Exception types
2 participants