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

[Core] Enforce CA1507 - use nameof() where possible #21962

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

symbiogenesis
Copy link
Contributor

@symbiogenesis symbiogenesis commented Apr 21, 2024

Enforces CA1507

This will allow potential future bugs to be discovered at compile-time, rather than at runtime.

I used a roslyn refactoring to accomplish this, but I sanity checked all of the individual changes.

@symbiogenesis symbiogenesis requested a review from a team as a code owner April 21, 2024 04:11
Copy link
Contributor

Hey there @symbiogenesis! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 21, 2024
@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

jsuarezruiz
jsuarezruiz previously approved these changes Apr 23, 2024
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

I am also thinking that this should actually also only happen in the library code. We have tests that should be fine, but I would rather not change the tests in the same PR that changes the library.

@jsuarezruiz jsuarezruiz self-requested a review April 24, 2024 13:24
@symbiogenesis symbiogenesis changed the title use nameof() where possible [Core] use nameof() where possible Apr 28, 2024
@symbiogenesis
Copy link
Contributor Author

I am also thinking that this should actually also only happen in the library code. We have tests that should be fine, but I would rather not change the tests in the same PR that changes the library.

Removed the changes to the tests, and now this is only impacting Core.

@symbiogenesis symbiogenesis changed the title [Core] use nameof() where possible [Core] Enforce CA1307 - use nameof() where possible Apr 28, 2024
@symbiogenesis symbiogenesis changed the title [Core] Enforce CA1307 - use nameof() where possible [Core] Enforce CA1507 - use nameof() where possible Apr 28, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Eilon Eilon added the area-architecture Issues with code structure, SDK structure, implementation details label May 15, 2024
@PureWeen
Copy link
Member

/rebase

@PureWeen
Copy link
Member

/azp run

@PureWeen PureWeen enabled auto-merge (squash) July 11, 2024 00:37
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho disabled auto-merge July 16, 2024 23:40
@rmarinho rmarinho merged commit 3b1d95a into dotnet:main Jul 16, 2024
95 of 97 checks passed
@symbiogenesis symbiogenesis deleted the nameof branch July 17, 2024 01:34
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-8.0.80 and removed fixed-in-net9.0-nightly This may be available in a nightly release! labels Aug 2, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-architecture Issues with code structure, SDK structure, implementation details community ✨ Community Contribution fixed-in-8.0.80 fixed-in-net9.0-nightly This may be available in a nightly release! t/housekeeping ♻︎
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants