StyleCop report (code style cleanup)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pinta |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I ran StyleCop -- a C# source code analysis program -- against Pinta and got a very long report, over 10,000 style warnings. (I'll attach the log but it is XML and not particularly readable, so I'll attempt to summarize some of the key points).
There are many spacing complaints, there seem to be several cases where Pinta uses more spaces than recommended but I'll ignore those. Also the same warnings get repeated far too many times to be readable, so I'll try to summarize.
SA1027 : CSharp.Spacing : Tabs are not allowed. Use spaces instead. -
AboutDialog.cs
AboutDialogActi
AboutPintaTabPa
AutoHideBox.cs
CloseAllDocumen
CloseDocumentAc
DockContainer.cs
... and lots, lots more other Dialogs and Actions files.
There are lots of warnings about being stricter with the placement of braces:
SA1503 : CSharp.Layout : The body of the if statement must be wrapped in opening and closing curly brackets. - D:\devel\
SA1500 : CSharp.Layout : If a statement spans multiple lines, the opening curly bracket must be placed on its own line. - D:\devel\
this comes up lots of times too:
SA1200 : CSharp.Ordering : All using directives must be placed inside of the namespace. -
DockBar.cs:32
probably not important though
http://
There is some minor detail in the way the copyright notice is formatted that results in StyleCop failing to recognise the copyright notice in many files
SA1634 : CSharp.
I'd like to clean up some of these after I get my other changes sorted (don't want to get started on more than one branch), posting this report in case anyone else wants to do any of it before me though.
Ideally there would be a pre-commit script that warned developers about this too
It seems git has a precommit-hook feature to run check scripts but I'm not that familiar with GIT yet
... or failing that some settings files that developers could optionally setup to work with their development environment.
Stylecop is not windows only as I previously thought, it seems to be also be available for MonoDevelop/ XamarinStudio addins. monodevelop. com/Project/ Index/54
http://