codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

How can one set CodeMaid to NOT sort anything?

Open mkamoski opened this issue 7 years ago • 2 comments

...

Dear CodeMaid Users,

Please help.

How can one set CodeMaid to NOT sort anything?

I like a lot of what CodeMaid does, and want most of it to happen, except sorting properties/methods/etc.

This is because where I am, code reviews are diff-based.

Sorting code (such as methods) adds a bunch of noise to the diff and the devs get confused.

So, I cannot let CodeMaid sort anything, such as methods or properties or usings.

I have set this...

CodeMaid, > Options, > Reorganizing, > (all items not-checked)

...so is that it?

Please advise.

(FWIW, if I had my way, I would let CodeMaid sort things, as I personally think it is best, but higher-ups do not like it, and lower-downs get confused by it, so I have to conform. Funny that unorganized code is somehow less confusing to some, but that is the way some are, I suppose.)

Thanks.

-- Mark Kamoski

...

mkamoski avatar Oct 23 '17 14:10 mkamoski

Reorganizing (when members get moved around based on their types) is an opt-in feature so out of the box it won't execute. There's two scenarios under which it will execute:

  1. If you explicitly invoke "Reorganize Active Document" it will of course run at that time.
  2. There is a configuration option at CodeMaid->Options->Reorganizing->General->"Run reorganize at start of cleanup". That is off by default, but if you have it turned on (or someone else has turned it on in the shared configuration file) then that will cause reorganization to run when cleanups are triggered.

Hope it helps!

codecadwallader avatar Oct 24 '17 12:10 codecadwallader

On a per-class basis, one can also include the following code comment at the top of the page

// <auto-generated Note="Disabling CodeMaid sorting." />
namespace MyProject { ... }

DamianSuess avatar Mar 28 '22 19:03 DamianSuess