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

New suffix is not mentioned in the CA1711 - Identifiers should not have incorrect suffix - page #45051

Closed
wmanning opened this issue Feb 26, 2025 · 0 comments · Fixed by #45120
Assignees
Labels
dotnet-fundamentals/svc in-pr This issue will be closed (fixed) by an active pull request. 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@wmanning
Copy link

wmanning commented Feb 26, 2025

Type of issue

Missing information

Description

The New suffix is not mentioned in the article.

The code is the "NewSuffix" in:
https://github.com/dotnet/roslyn-analyzers/blob/main/src/NetAnalyzers/Core/Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/IdentifiersShouldNotHaveIncorrectSuffix.cs

I suggest adding a section on "New" under the Rule description section with something like "New should not be used as a suffix if there is another member with the same name minus the suffix as it implies the member replaces the other member"

For one of my enums I have two members "Attached" and "AttachedNew" and I get a warning: "CA1711 - Either replace the suffix 'New' in member name AttachedNew with the suggested numeric alternate '2' or provide a more meaningful suffix that distinguishes it from the member it replaces"

I was confused first why I was getting the error as my member does not replace the other member and was searching for any documentation on the "New" suffix. At first I thought maybe it was due to the reserved keyword "new".

Page URL

https://learn.microsoft.com/en-ca/dotnet/fundamentals/code-analysis/quality-rules/ca1711

Content source URL

https://github.com/dotnet/docs/blob/main/docs/fundamentals/code-analysis/quality-rules/ca1711.md

Document Version Independent Id

80a9b228-4707-b401-d96c-e07fe2b8514c

Article author

@gewarren

Metadata

  • ID: ee21bb5f-3fa5-f932-d8b1-2d1cc7d92be8
  • PlatformId: ae26b74b-fbe7-fb6a-555d-4ac32cd1c731
  • Service: dotnet-fundamentals

Related Issues


Associated WorkItem - 402486

@dotnet-policy-service dotnet-policy-service bot added the ⌚ Not Triaged Not triaged label Feb 26, 2025
@gewarren gewarren self-assigned this Mar 4, 2025
@dotnetrepoman dotnetrepoman bot added the 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. label Mar 4, 2025
@gewarren gewarren added the 🗺️ reQUEST Triggers an issue to be imported into Quest. label Mar 4, 2025
@dotnet-policy-service dotnet-policy-service bot removed 🗺️ mapQUEST Only used as a way to mark an issue as updated for quest. RepoMan should instantly remove it. ⌚ Not Triaged Not triaged labels Mar 4, 2025
@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label Mar 4, 2025
@github-project-automation github-project-automation bot moved this from 🔖 Ready to ✅ Done in dotnet/docs March 2025 sprint project Mar 4, 2025
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet-fundamentals/svc in-pr This issue will be closed (fixed) by an active pull request. 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants