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

add toml formatter for pyproject.toml #775

Closed
wants to merge 1 commit into from
Closed

Conversation

AlexandreKempf
Copy link
Contributor

Copy link
Collaborator

@dberenbaum dberenbaum left a comment

Choose a reason for hiding this comment

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

Thanks @AlexandreKempf! We try to simplify maintenance and consistency by using a single template for our projects in https://github.com/iterative/py-template. Any project setup ideas you have should probably go there instead of directly into dvclive.

@AlexandreKempf
Copy link
Contributor Author

Ah! I understand now why it was not using a formatter already.
We cannot use a pre-commit formatter on cookie-cutter projects because the TOML/YAML files are not valid TOML/YAML before the project is initiated.
We can keep it for this repo, or we can remove it, as you prefer ;)

@dberenbaum
Copy link
Collaborator

@AlexandreKempf Good point, but unless I'm missing something, I still think you could add the changes back to that cookiecutter manually so that:

  1. The formatting will be fixed in the template
  2. The generated projects will inherit the pre-commit formatter

@AlexandreKempf
Copy link
Contributor Author

@dberenbaum I'm wondering if I get you right. Or maybe I wasn't clear enough in my comment.
If I add the formatters in the py-template's pre-commit, it will try to pre-commit the py-template project. Or there are plenty of toml files that are not valid for the formatter (stuff like {%- if cookiecutter.docs != "False" %}), and at the end, the project refuses to commit my changes.

Is there something I'm missing? What did you have in mind exactly?

@dberenbaum
Copy link
Collaborator

It might be my misunderstanding since I haven't tried it. Are you putting it inside or outside the cookiecutter? Does it run the pre-commit inside the cookiecutter?

@AlexandreKempf
Copy link
Contributor Author

Oh my mistake! I putted it outside :( Thanks for the explanation.
I'm doing the PR on py-template :)

@dberenbaum dberenbaum closed this Feb 8, 2024
@skshetry skshetry deleted the toml-formatter branch March 6, 2024 07:18
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.

2 participants