Description
Batch styling? Right-click clean up? Quick code format fixing?
That's what what I have in my mind about today's extension.
Pick a C# File, right-click and select "Clean up" and Run. And then check out your now cleaned up and formatted code.
That's today's extension!
Tidy C#
A Visual Studio extension that adds a few enhancements to improve C# code development. It provides a list of automatic refactoring tools for cleaner C# code.
- Close all open windows
- Right click on a C# file, folder, project or even the whole solution.
- Select "Clean up C#..."
- In the pop-up select the clean up actions you are interested in.
- Click Run
It will then open each file, apply the clean up actions, save and close. It can take a few minutes for a large codebase.
Recommendation
Check out all of its changes in your source control tool diff tool.
It's open source too (and under active development... ;)
Follow @CH9
Follow @coding4fun
Follow @gduncan411
More episodes in this series
"Greg The Robot"
Related episodes
Smart Code Coloring with CoCo
Visual Studio 2017 Refactoring Essentials
Code Analysis at Compile? Why? Do it Live!
F3 is so yesterday... The Sando Visual Studio Extension provides real code indexing,…
Meaningful Comments with Memeful Comments
Taking the Pain out of Proj Editing
Putting a Hex on Visual Studio
Your New Virtual API Review Assistant
Is It Inlined?
Please ask it in the form of a question...
The Discussion
-
Darren_Evans Another great tool is Code Maid
-
gduncan411 -
Dev Useless tool that employ bad coding practices and can cause damage to good, clean and neat code: removing brackets from one liners? Bad and bug prone. Removing private keywords? Useless and bad, the code is cleaner and clearier with emplicit programming instead of implicit. Var for variable declarations? I hate vars! State your purpose that's the whole point of strongly typed language. Bug prone and hides intent.
-
Nick dotnet/corefx Coding Style
- We always specify the visibility, even if it's the default -
dandy @Dev: Seems to me this is exactly why every option has a checkbox.
-
Dev Dandy, having the ability to enable bad code practices is prone to misuse and misunderstanding by noob developers, those checkboxes should never be marked.
If you had the ability to reverse those options, like adding privates keywords and brackets for oneliners for example, I'd agree.
But reading what I wrote earlier, I did sound like a big douche (I had a rough morning), so appologies all around. -
wkempf @Dev Some of what you said I can agree with, and some absolutely not. You want a strongly typed language? Try Haskell. Oh, BTW, Haskell relies heavily on type inference (your hated var). Can you write bad code with it? Yes, but that's true of every API, operator, keyword and feature.
You obviously have a strong idea of what "good maintainable code" looks like. Doesn't it make sense to use tools to enforce that, and make it easier? You hate var. Wouldn't you want something to ensure your team doesn't use it then?
