Skip to content

Make Canonicalizer modular #1053

@WardBrian

Description

@WardBrian

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=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:
  • We can then make --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

Metadata

Metadata

Assignees

Labels

featureNew feature or requesthelp wantedExtra attention is neededinterfacecommand line interface

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions