-
-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Labels
featureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededinterfacecommand line interfacecommand line interface
Description
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:
- All pretty printing is done with
--auto-format. - Add an additional argument which allows you to specify certain canonicalizations to use. For example,
--auto-format --canonicalize=deprecationswould 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.
- We can then make
--print-canonicala 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededinterfacecommand line interfacecommand line interface