From fe3897bed9b180a1ba6c9004468b3817cc536f90 Mon Sep 17 00:00:00 2001 From: Klaas Schoute Date: Sat, 1 Jun 2024 13:39:05 +0200 Subject: [PATCH] Update the documentation for commands with pre-commit --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a79452..07067e7 100644 --- a/README.md +++ b/README.md @@ -131,12 +131,34 @@ poetry shell exit ``` +Setup the pre-commit check, you must run this inside the virtual environment: + +```bash +pre-commit install +``` + +*Now you're all set to get started!* + +As this repository uses the [pre-commit][pre-commit] framework, all changes +are linted and tested with each commit. You can run all checks and tests +manually, using the following command: + +```bash +poetry run pre-commit run --all-files +``` + To run just the Python tests: ```bash poetry run pytest ``` +To update the [syrupy](https://github.com/tophat/syrupy) snapshot tests: + +```bash +poetry run pytest --snapshot-update +``` + ## License MIT License @@ -181,4 +203,5 @@ SOFTWARE. [last-commit-shield]: https://img.shields.io/github/last-commit/home-assistant-libs/forecast_solar.svg?style=for-the-badge [poetry-install]: https://python-poetry.org/docs/#installation -[poetry]: https://python-poetry.org \ No newline at end of file +[poetry]: https://python-poetry.org +[pre-commit]: https://pre-commit.com