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

[Py Reformat] Exclude third-party in code-format-helper.py #83872

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

mtrofin
Copy link
Member

@mtrofin mtrofin commented Mar 4, 2024

Follow-up from PR #83491. Darker's configuration is ignored because of the way we invoke it - with an explicit list of files. We need to filter it in code-format-helper.py.

Follow-up from PR llvm#83491. `Darker`'s configuration is ignored because of
the way we invoke it - with an explicit list of files. We need to filter
it in `code-format-helper.py`.
@mtrofin mtrofin requested a review from tru March 4, 2024 16:53
@mtrofin
Copy link
Member Author

mtrofin commented Mar 4, 2024

@tru I'm not sure the current setup is very maintainable - my concern is scenarios where one uses (say) vscode for development and wants to auto-format. Ideally they'd say "using darker, with whatever project defaults" and move on. Right now that's not quite the case, since (iiuc) the project settings are ignored by darker - or perhaps only the file exclusion list is (or maybe I'm not using the tools well)

@tru
Copy link
Collaborator

tru commented Mar 4, 2024

@tru I'm not sure the current setup is very maintainable - my concern is scenarios where one uses (say) vscode for development and wants to auto-format. Ideally they'd say "using darker, with whatever project defaults" and move on. Right now that's not quite the case, since (iiuc) the project settings are ignored by darker - or perhaps only the file exclusion list is (or maybe I'm not using the tools well)

Definitely open to suggestions if you think we can improve this. The reason we pass the list of files on the command line is otherwise darker will (naively) scan the whole repo worth of .py file in order to calculate the diff. It was incredible slow. I have already done work on the code formatter so that it can be used as a git pre-commit hook, so maybe it's just better we use it that way?

Copy link
Collaborator

@tru tru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mtrofin mtrofin merged commit a81a7b9 into llvm:main Mar 4, 2024
4 of 5 checks passed
@mtrofin mtrofin deleted the codeformat branch March 4, 2024 19:22
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