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

SA1604, SA1615 do not support the <include> tag #1603

Closed
qmfrederik opened this issue Oct 6, 2015 · 3 comments
Closed

SA1604, SA1615 do not support the <include> tag #1603

qmfrederik opened this issue Oct 6, 2015 · 3 comments
Assignees
Milestone

Comments

@qmfrederik
Copy link

Consider the following files:

Class.cs:

// <copyright file="Class1.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>

namespace ClassLibrary3
{
    using System.Threading.Tasks;

    /// <summary>
    /// Sample class.
    /// </summary>
    public class Class1
    {
        /// <include file='Class1.xml' path='/Class1/Foo/*'/>
        public async Task Foo()
        {
            await Task.Delay(0);
        }
    }
}

Class1.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Class1>
  <Foo>
    <summary>
      Sample method.
    </summary>
    <returns>
      A <see cref="Task"/> representing the asynchronous operation.
    </returns>
  </Foo>
</Class1>

The method Foo is documented and the C# compiler correctly generates the documentation for this method.

However, StyleCop reports:

Warning SA1604  Element documentation must have summary ClassLibrary3   Class1.cs   15
Warning SA1615  Element return value must be documented ClassLibrary3   Class1.cs   

Classic StyleCop did support XML <include> statements

@sharwell sharwell added the bug label Oct 7, 2015
@sharwell sharwell self-assigned this Oct 7, 2015
@sharwell
Copy link
Member

sharwell commented Oct 8, 2015

Well, I had no trouble reproducing this but I'm having a ton of trouble getting unit tests to work. I'm starting to think the AdhocWorkspace we use doesn't support resolving files specified in documentation comments. 😶

@sharwell
Copy link
Member

sharwell commented Dec 4, 2015

Special thanks to @daveaglick who unblocked my testing on this!

@daveaglick
Copy link

👍

sharwell added a commit to sharwell/StyleCopAnalyzers that referenced this issue Dec 4, 2015
This change only updates SA1604, SA1606, and SA1615 to properly handle
these comments.

Fixes DotNetAnalyzers#1603
@sharwell sharwell added this to the 1.0.0 RC 2 milestone Dec 4, 2015
This was referenced Dec 4, 2015
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

3 participants