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

Add compiler warning about CS file name not matching the class/interface contained within #74092

Open
ericwood8 opened this issue Jun 21, 2024 · 0 comments
Labels
Area-IDE Feature Request untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@ericwood8
Copy link

Summary

Add compiler warning about CS file name not matching the class/interface contained within. Maybe wording could be "File Name/Class Name mismatch."?

Background and Motivation

Help produce cleaner code

User Impact

None, except for seeing warning on build.

Which Files?
Skip:
CS files with multiple classes
non-class & non-interface CS files
non-CS files such as *.html

Include:
CS files with interface

Implementation

Would delay building/rebuilding but can minimize impact of checking. Maybe cache a integer (0=no known mismatches, 1=known mismatches, 2=unknown state) that there are problems or not. If problems, then keep checking on subsequent compiles. If no problems with file/class name mismatches, then no need to check on subsequent build/rebuilds. If freshly starting VS, then start with unknown state. If load a new solution into VS, then reset the cache to an unknown state.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant