codecadwallader/codemaid

Feature Request: Add option for conditional per-file Automatic Cleanup on Save based on comment at top of file

RichardSinden opened this issue · 0 comments

Environment

  • Visual Studio 2022
  • CodeMaid version: 12.0.300
  • Code language: Anything CodeMaid supports

Description

I'm working on a large legacy codebase and I don't want to automatically cleanup every file that I save, because reorganising everything creates a bit of pain detecting actual changes in the changelogs. However, when I add a new file, I would like the option to tag that file to always be cleaned up on save.

Therefore, I propose adding an option to make the automatic cleanup conditional, based on a configurable comment at the top of the file.
When cleanup is run manually on a file then CodeMaid should write the comment to the file. e.g. defaulting to something like
// Auto-organized by CodeMaid
(obviously the comment syntax would need to be appropriate to the language)

When a file is saved then CodeMaid should check for the presence of the comment and, if it exists, then cleanup can be performed. If it doesn't then the file should be ignored by CodeMaid.