We can start with a Duplicate of an existing profile, and then start customizing. ![]() ![]() To run a custom set of tasks, we’ll have to create a custom code cleanup profile from the ReSharper | Options menu, under Code Editing | Code Cleanup and specify the set of desired tasks there. When no additional settings are specified or no custom cleanup profile is found in the solution shared settings, CleanupCode.exe will make use of ReSharper’s Full Cleanup profile. Out of the box, ReSharper ships with two default code cleanup profiles: Reformat Code (only applies code formatting rules) and Full Cleanup (which applies all available cleanup tasks (except adding a file header). ![]() Tip: after running CleanupCode.exe, a git diff will reveal any changes that were made by the tool. The tool will scan all files in our solution and apply code formatting rules specified in the Full Cleanup profile: Since the tool can target a project or solution, let’s dive in at once and run it against the latest YouTrackSharp solution: Note that these are free and do not require us to have the full ReSharper installed (except for creating custom code cleanup profiles).Īfter downloading and unzipping the command line tools, either on a local machine or a CI server, we can run CleanupCode.exe to automatically apply code formatting and code style preferences. Getting started with the Code Cleanup command line toolįirst, we will have to download the ReSharper Command Line Tools that contain Code Cleanup. ![]() This instantly eliminates code style violations in a project or solution, and ensures a uniform code base. The new Code Cleanup command line will apply formatting code style preferences and other improvements such as file layout, removing redundancies, optimizing using, … in bulk mode. Along with the latest releases of ReSharper, we have made Code Cleanup part of the ReSharper Command Line Tools. These tools allow us to run several ReSharper features from the command line or as part of continuous integration. Two tools have been there for a while - InspectCode (which can run hundreds of ReSharper code inspections outside of Visual Studio) and dupFinder (which helps finding duplicate code in C# and VB.NET code).
0 Comments
Leave a Reply. |