Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Canonicalizer modular #1053

Closed
WardBrian opened this issue Nov 22, 2021 · 0 comments · Fixed by #1058
Closed

Make Canonicalizer modular #1053

WardBrian opened this issue Nov 22, 2021 · 0 comments · Fixed by #1058
Assignees
Labels
feature New feature or request help wanted Extra attention is needed interface command line interface

Comments

@WardBrian
Copy link
Member

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

@WardBrian WardBrian added help wanted Extra attention is needed feature New feature or request interface command line interface labels Nov 22, 2021
@WardBrian WardBrian self-assigned this Nov 23, 2021
@WardBrian WardBrian mentioned this issue Nov 24, 2021
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request help wanted Extra attention is needed interface command line interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant