Closed sarahmonod closed 1 year ago
The pre-commit hook for prettier is mirrors-prettier, and it is not a Python package. However, we can run prettier through pre-commit
as follows:
pre-commit run prettier --files <files>
In order to do that we would need to ensure that the hooks were installed:
pre-commit install # needs to be run once
Therefore, if we wanted to use this in make lint
, we either need to assume that pre-commit install
was run previously, or have the make lint
command check and run the install before running prettier.
As for the GitHub Actions, we can switch to run the pre-commit hooks in addition to mypy
and remove the npm install -g prettier
logic and just replace it with the pre-commit install
.
As of now, the
make lint
target will runprettier
, which is a NPM package that is used to lint and format markdown, js and css files. There is also a PyPI package calledprettier
, which pretty prints python dicts.The
prettier
dependency is not in thepackage.json
dev dependencies, and is installed manually inside theDockerfile
and the GitHub Action CI.There is also work under-way to use pre-commit hooks to improve the linting, which may affect this.
What we may want to do one of the following:
prettier
to useprettier
automatically, maybe through thepackage.json
dev dependencies section.