Question

So basically StyleCop insists I have a header on all my source files that look like this:

//-----------------------------------------------------------------------
// <copyright file="NameOfFile.cs" company="CompanyName">
//     Company copyright tag.
// </copyright>
//-----------------------------------------------------------------------

Which I suppose is nice if you're writing propriety software for Microsoft Corporation. In this case however it's an open source (MIT license) project, not affiliated with any company.

Now I realize that StyleCop is a Microsoft tool and the idea of someone making Copyleft software in their spare time in C# is an alien concept, because being paid exorbitant amounts of money by a company is apparently the only legitimate reason why one would choose to write something in C#, and that private projects should be written in one of the cooler hippie languages like Python or Scala.

So it's an open source project, why care about what StyleCop thinks? Well other people are going to be reading the code, so I'd like to make it as nice, readable and "standards compliant" as I can, to make it as accessible to everyone as possible.

So how does everyone else solve this issue? Am I being too pedantic?

Was it helpful?

Solution

StyleCop rules can be customized to your needs using the Settings.StyleCop file. Many of the rules in StyleCop are helpful, but there are always some who do not fit for your project. The customization of the rules are that common that there is a GUI for this task.

After you removed the rules you do not want you should check in the Settings.StyleCop file in your source control. All the other developers can use this file to check for the same rules in this project and do not report errors for rules you don't care.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top