dfmt icon indicating copy to clipboard operation
dfmt copied to clipboard

proposed enhancement: dfmt oneoff

Open katastic opened this issue 1 year ago • 0 comments

dfmt doesn't support one line exceptions to rules, only multi-line blocks. That is overly verbose for removing single style errors. It also introduces the possibility of ignoring (and missing) multiple errors if users place them at natural boundaries at beginning/ending of blocks (say, start/end of a struct which ignores intended issue but also ignores an additional style violation inside by accident).

struct rect { float x, y, w, h; }  
"Struct name 'rect' does not match style guidelines"

current solution:

// dfmt off
struct rect { float x, y, w, h; } 
// dfmt on

A natural solution would be support for single line rule exceptions:

proposed solution:

struct rect { float x, y, w, h; } // dfmt oneoff

katastic avatar Jul 02 '24 08:07 katastic