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

ExcludeFromStyleCop not respected by the VS extension #53

Open
MT-PL-SWF-Dev opened this issue Jan 22, 2016 · 6 comments
Open

ExcludeFromStyleCop not respected by the VS extension #53

MT-PL-SWF-Dev opened this issue Jan 22, 2016 · 6 comments
Assignees

Comments

@MT-PL-SWF-Dev
Copy link

ExcludeFromStyleCop works fine for project's build.

But when using "Run StyleCop (Rescan All)" from the VS extension on a solution level it still raises warnings, e.g.:
SA1633 : CSharp.Documentation : The file has no header, the header Xml is invalid, or the header is not located at the top of the file.

I have installed the extension directly from nuget.

@ptittof57 ptittof57 added the bug label Jan 26, 2016
@ptittof57 ptittof57 self-assigned this Jan 31, 2016
@ptittof57
Copy link
Contributor

It is the AssemblyInfo.cs file ?

@MT-PL-SWF-Dev
Copy link
Author

Yes, it is. We actually have AssemblyInfo split into two - common between projects (which is added as link) and project-specific which is added in a standard way. The issue occurs for both files.

@ptittof57
Copy link
Contributor

@MT-PL-SWF-Dev I can't reproduce this issue, could you send me a zip of your solution, and projects (with AssemblyInfo only). You can remove all other cs files from your personal code this is just to try on my side

@MT-PL-SWF-Dev
Copy link
Author

I enclose a zip with sample project and some print screens in main directory. I hope this helps.
Test.zip

@ptittof57
Copy link
Contributor

I found this explicit code for links:

                var isLinkProperty = item.Properties.Item("IsLink");

                if (isLinkProperty != null && bool.Parse(isLinkProperty.Value.ToString()))
                {
                    // The ProjectItem is a linked file to we'll assume these haven't got
                    // ExcludeFromStyleCop in the proj file
                    return true;
                }

I don't want to remove this code so I think the best solution is to add a new parameter.

@MT-PL-SWF-Dev
Copy link
Author

How does the linked file differ from a regular one? Both are tested against StyleCop violations, so I would actually assume the other way around - that it may have ExcludeFromStyleCop attribute.

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