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

[llvm][Docs] Show how to format Python files changed in a commit #66227

Closed
wants to merge 1 commit into from

Conversation

DavidSpickett
Copy link
Collaborator

black will always work on whole files and darker seems to be the only way to get it to work on chunks of files as you would with clang-format and https://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting.

This adds a one liner for the common use case. In theory you can not list files and use . as the path instead but it seems to find all python files, then see if they have changed. Instead of starting with the change list. So it takes ages on llvm-project/.

black will always work on whole files and darker seems to be the only
way to get it to work on chunks of files as you would with
clang-format and https://clang.llvm.org/docs/ClangFormat.html#script-for-patch-reformatting.

This adds a one liner for the common use case. In theory you can not list
files and use `.` as the path instead but it seems to find all python files, then
see if they have changed. Instead of starting with the change list. So
it takes ages on llvm-project/.
@DavidSpickett
Copy link
Collaborator Author

We could just link to it however the example given on https://pypi.org/project/darker/ will take ages to run on llvm-project, for the reason noted in the commit message.

@tru
Copy link
Collaborator

tru commented Sep 13, 2023

I think this is a dupe of #66141

@DavidSpickett
Copy link
Collaborator Author

I'll just comment on the other PR.

@DavidSpickett DavidSpickett deleted the llvm-darker branch September 21, 2023 14:15
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

Successfully merging this pull request may close these issues.

None yet

2 participants