Partilhar via


SourceAnalysis: Tool to enforce coding style

People just love to write code. One tool that is used inside Microsoft is StyleCop which enforces code style guidelines on the code we write. Its always been a ask from customers to get this out and guess what its out!!

https://code.msdn.microsoft.com/sourceanalysis

The tool on installation integrates with the VS IDE so the usage is very simple. The rules can be tweaked so that you dont have to follow everything.

 "Specifically, these rules cover the following, in no particular order:

  • Layout of elements, statements, expressions, and query clauses
  • Placement of curly brackets, parenthesis, square brackets, etc
  • Spacing around keywords and operator symbols
  • Line spacing
  • Placement of method parameters within method declarations or method calls
  • Standard ordering of elements within a class
  • Formatting of documentation within element headers and file headers
  • Naming of elements, fields and variables
  • Use of the built-in types
  • Use of access modifiers
  • Allowed contents of files
  • Debugging text

" Look at the post for more details

Share this post

Comments