-
Notifications
You must be signed in to change notification settings - Fork 11
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
pyproject.toml cleanup #50
Comments
Using toml-sort in a pre-commit hook is an effective way to resolve this issue. |
I was not very careful with managing whitespace in the jinja statements. Doing some kind of automated formatting would be my preferred option, too. |
toml-sort looks nice, but I'm not sure how to best introduce it. I see the following possible solutions:
|
if we move the actual items in the template into sidecar |
I've been keeping an eye on https://github.com/tox-dev/pyproject-fmt, and I think most of the kinks are worked out. I'd be in favor of adding that to the pre-commit hooks in the template. |
How about adding a call to that as a post-generation script with this: https://copier.readthedocs.io/en/stable/configuring/#tasks Rather than as a pre-commit hook? It would be nice to separate the code generation part from the generated code, so e.g. someone could choose not to use the pre-commit hooks and still get a formatted pyproject.toml |
See caveats of option 2 that I listed above with regard to tasks. |
Aha, ya im back to "lets just split off the deps into yaml and sort them in the template" Here ill do this and test the output against the formatter one sec. Also curious how this plays with being able to update the template, like if someone adds deps to a project (which we assume will happen 99.9% of the time) does that break their ability to update? Idk how that works. I feel like if formatting happens after templating that also increases the odds we get spurious update conflicts |
If you are familiar with handling merge conflicts, the update experience is okay, I think. If not, it's probably a bit of a challenge. |
Is it possible to clean up the pyproject.toml just a little bit so the spacing is uniform between tables? It will be easier to read if each table has a space after it! some do and others don't.
The text was updated successfully, but these errors were encountered: