CleanupCode Command-Line Tool
CleanupCode is a free command-line tool that can perform code cleanup to instantly eliminate code style violations in a project or solution and ensure a uniform code base. To use CleanupCode, you need to download ReSharper Command Line Tools, unzip the command line tools package, and then run:
Configuring CleanupCode with command-line arguments
By default, CleanupCode will scan all files in the solution and apply code cleanup tasks specified in the Full Cleanup profile.
There is one more built-in profile — Reformat Code, which will apply only code formatting preferences. To use it, pass the profile name via the
--profile command-line argument of cleanupcode.exe:
cleanupcode.exe --profile="Built-in: Reformat Code" YourSolution.sln
--profile, you can use the following command-line arguments:
--settings— by default, CleanupCode will override its default settings with ReSharper settings from the 'Solution team-shared' layer (SolutionName.DotSettings), if it exists. If necessary, you can use this parameter to specify another .DotSettings file, which will override all other settings. For example,
--include/--exclude— relative path(s) that define the files to include/exclude during the cleanup.
-dsl) — disables specified settings layers. Accepted values:
Several options related to MSBuild, cache folders, etc. Details are available from
--config— these options allow you to pass the parameters described above with a configuration file. The first option will create a configuration file according to the current parameters; the second option is used to load the parameters from this file.
Configuring CleanupCode with ReSharper settings
If you have previously worked on the target solution with ReSharper, you may have already configured code style settings. If so, CleanupCode will find your custom settings in .DotSettings files and apply them.
CleanupCode will read the following preferences from ReSharper-settings files:
Code formatting rules ( and )
Syntax styles ( )
If you want to configure CleanupCode on a CI server, you can make all configurations locally with ReSharper, save the settings to the Solution Team-Shared layer, and then commit the resulting YourSolution.sln.DotSettings file in the solution directory to your VCS. CleanupCode on the server will find and apply these settings.
As an alternative, you can specify a path to a shared .DotSettings file (which will override settings in other settings files, if any) through the