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

Prettier Pre-commit Hooks #96

Open
2 tasks
kenibrewer opened this issue Oct 14, 2023 · 1 comment
Open
2 tasks

Prettier Pre-commit Hooks #96

kenibrewer opened this issue Oct 14, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@kenibrewer
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Docs diffs become much easier to maintain when there is an opinionated code formatter for the Markdown files such as Prettier.
Prettier also allows opinionated formatting of other files relevant to python projects including YAML and JSON.

Describe the solution you would like

An ideal solution would consist of the following:

Additional context

If this feature is of interest, feel free to assign it to me for completion.

@kenibrewer kenibrewer added the enhancement New feature or request label Oct 14, 2023
@fpgmaas
Copy link
Owner

fpgmaas commented Oct 16, 2023

This sounds good to me! The only challenge I foresee here is that currently, when running

pip install cookiecutter
cookiecutter https://github.com/fpgmaas/cookiecutter-poetry.git

the following commands will run successfully:

cd <project_name>
git init -b main
git add .
git commit -m "Init commit"
git remote add origin [email protected]:<github_author_handle>/<project_name>.git
git push -u origin main

and the CI/CD pipeline will run successfully. However, after introducing this pre-commit hook, the CI/CD pipeline will likely fail. The reason for this is that it is incredibly difficult to format all the files in the {{cookiecutter.project_name}} folder in exactly such a way that, whichever combination of argument a user gives, they are exactly in the format prettier would want. And even if we manage to do so, it is an unrealistic goal that we manage to keep it that way.

So we would maybe need to update the set of commands above to also run the pre commit hooks once before pushing.

If we can manage to find a clean solution to that, I am happy with this change!

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

No branches or pull requests

2 participants