DotNet Mirror
  DNM facebook   DNM Google+   DNM Twitter   

Dotnet codeformatter released to GitHub

By Ashok Nalam on 11 Feb 2015 | Category: Visual Studio | Tagged: GitHub open source C# visual studio 2015 
Microsoft has released codeformatter on GitHub. This tool uses Roslyn which can be used to format C# project code automatically as per guidelines. With the source code format we will have better readability and maintainability of a code.
  Discuss Add Comment   |  
Add rating Rate this resource   

Introduction

Microsoft has released codeformatter on GitHub. This tool uses Roslyn which can be used to format C# project code automatically as per guidelines . With the source code format we will have better readability and maintainability of a code.

dotnet codeformatter on GitHub

Prerequisite:

In order to run this tool we need to have Microsoft Build Tools 2015 Preview installed on machine and it comes as part of Visual Studio 2015 preview.

Usage:

The tool is fairly simple to use. Just we have to pass project or solution file to codeformatter exe so that it converts all files according to prescribed coding style.

Example:
codeformatter.exe MySamplePorject.csproj
codeformatter.exe MySamplePorject.sln

We can pass more parameters to CodeFormatter like below
$ .\CodeFormatter.exe
CodeFormatter <project or solution> [<rule types>] [/file <filename>]
    <rule types> - Rule types to use in addition to the default ones.
                            Use ConvertTests to convert MSTest tests to xUnit.
    <filename>   - Only apply changes to files with specified name.
    <configs>    - Additional preprocessor configurations the formatter
                           should run under.
    <copyright>  - Specifies file containing copyright header.

How it is differ from Ctrl-K-D:

It is similar to Ctrl-K-D option in visual studio but additionally it has removing old copyright headers or adding new ones which Ctrl+K+D doesn't support. 

References:


  Discuss Add Comment    
Add rating Rate this resource   
About the Contributor
Member Since : 10 Dec 2012
Member Points (Level) : 9526  (Professional)
Location : INDIA
Home Page : http://dotnetmirror.com
About : I am admin of this site.
Rate this resource
 
Add your Comment
Name Email WebSite
Captcha Refresh


Comments (0)
No comments found, click here to add comment.
 
cheap jordans|wholesale air max|wholesale jordans|wholesale jewelry|wholesale jerseys