Make Canonicalizer modular #1053
Labels
feature
New feature or request
help wanted
Extra attention is needed
interface
command line interface
Currently,
--print-canonical
does a lot of different things to your code. Especially with the incoming deprecation changes, I think it would be great to have a way to pick and choose what it does.I propose something like this, first discussed in #1042:
--auto-format
.--auto-format --canonicalize=deprecations
would only update deprecated features, not add/remove parenthesis etc. This is a comma separated list of options.By my count, we would have the following options to start:
deprecations
- deprecated syntax and function replacementincludes
- see Support pretty-printing without inlining #include-d code #1042parenthesis
- the current canonicalizer removes extra parenthesisbraces
- the current canonicalizer adds{}
around single-line if/else (...etc) blocks.--print-canonical
a synonym for--auto-format --canonicalize=(all options enabled)
This also allows us in the future to add possible more opinionated canonicalizers which we don't want enabled for all users, or even mutually exclusive options.
I think this would be good to tackle alongside #24, and a similar design could be used for #549
The text was updated successfully, but these errors were encountered: