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

tidy-imports with no reformatting? #206

Open
indigoviolet opened this issue Sep 10, 2022 · 2 comments
Open

tidy-imports with no reformatting? #206

indigoviolet opened this issue Sep 10, 2022 · 2 comments

Comments

@indigoviolet
Copy link

Is it possible to run tidy-imports without any sort/align/wrap changes? It's great for missing/mandatory/unused imports, but doesn't quite do the formatting job exactly like black (see for example #154). It would be better to leave that task to black.

@Carreau
Copy link
Collaborator

Carreau commented Sep 14, 2022

It is complicated as ast does not keep comments. Might be possible if there is no removal/addition, and just a reorder.

@indigoviolet
Copy link
Author

Reposting comment from #154: Have you considered using https://github.com/Instagram/LibCST or https://tree-sitter.github.io/tree-sitter/ to get a concrete syntax tree to address this? libcst in particular is built for this purpose: https://libcst.readthedocs.io/en/latest/why_libcst.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants