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

SA1649 - File name must match first type name - false positive error #1829

Closed
soerennielsen opened this issue Nov 26, 2015 · 3 comments
Closed
Assignees
Milestone

Comments

@soerennielsen
Copy link

This rule mistakenly fires for files with double postfix names, i.e.

File "AppEventReceiver.svc.cs"

That contains class:
public class AppEventReceiver : AppEventReceiverBase

Will fire the rule. It shouldn't and it doesn't in the original stylecop tool. .

Fix should be fairly easy by using the filename "before the first dot" instead of "filename without extension" for matching the class name.

And thanks for a great tool :-)

@sharwell
Copy link
Member

Thanks for the report. I think that makes sense, and it should definitely be an easy fix 👍

@sharwell
Copy link
Member

Well this didn't qualify as easy after all - it required modifications to the test framework to allow testing these cases. But I got it working!

sharwell added a commit to sharwell/StyleCopAnalyzers that referenced this issue Nov 26, 2015
sharwell added a commit to sharwell/StyleCopAnalyzers that referenced this issue Nov 26, 2015
sharwell added a commit to sharwell/StyleCopAnalyzers that referenced this issue Nov 26, 2015
@soerennielsen
Copy link
Author

Fantastic, thanks! :-)

Looking forward to RC1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants