开发者

How to find empty method/class XML summaries in Visual Studio?

开发者 https://www.devze.com 2022-12-12 13:22 出处:网络
i have noticed a number of empty开发者_如何学编程 method and class summary sections throughout a solution. It\'s rather large, hundreds of files/classes in a dozen projects. The empty summaries look s

i have noticed a number of empty开发者_如何学编程 method and class summary sections throughout a solution. It's rather large, hundreds of files/classes in a dozen projects. The empty summaries look something like this:

    ///<summary>
    ///</summary>

My question is: How do i form a regex expression in the Visual Studio file search to find all of the empty summaries in my solution?

Thanks!


No need to get your hands dirty - just use MS StyleCop. It's free, checks (among many other things) exactly what you need and gives a detailed report about it.

HTH!


^[ \t]*/// \<summary\>\n[ \t]*/// \</summary\>

if you type, watch the spaces. There are 4: before every \t and before every \<

If you want to allow space after the first line, the regexp becomes:

^[ \t]*/// \<summary\>[ \t]*\n[ \t]*/// \</summary\>

but msstylecop may be better, i don't know it yet ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消