๐งน One Click, Whole File Formatted
Remove unused usings, sort imports, fix spacing, apply conventions โ all automatically. Code Cleanup saves hours of manual formatting.
๐ง Set Up Profile
Analyze โ Code Cleanup โ Configure
Create profiles:
- "Full Cleanup": Remove/sort usings, format document, apply file header
- "Quick Fix": Only remove usings + format
- "Team Standard": Enforce team conventions
Shortcut: Ctrl + K, Ctrl + E (run last profile)
Ctrl + K, Ctrl + L (select profile)
โจ .editorconfig Integration
# .editorconfig in repo root root = true [*] indent_style = space indent_size = 4 trim_trailing_whitespace = true [*.cs] # Enforce team conventions automatically dotnet_sort_system_directives_first = true dotnet_separate_import_directive_groups = true csharp_using_directive_placement = outside_namespace
โ What It Fixes Automatically
- Remove unnecessary using statements
- Sort usings (System.* first)
- Apply spacing (braces, indentation)
- Add/remove blank lines between members
- Fix naming violations (if configured)
- Apply file header template
๐ก Pro Tip: Run on Save
Tools โ Options โ Text Editor โ Code Cleanup Check "Run Code Cleanup on Save" Now every file you save is automatically formatted to team standards. Zero manual formatting effort forever.
“PR comments were 80% about formatting. Added .editorconfig and Code Cleanup profile. Now formatting is automatic. Reviews focus on logic, not spaces.”
