From 53aa81e59075d878a544486663f1e8461b74cb7e Mon Sep 17 00:00:00 2001 From: bbhtt Date: Tue, 24 Sep 2024 19:13:23 +0530 Subject: [PATCH] README: Add instructions for pre-commit and removing venv --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 14e2fa1e..b0513111 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,9 @@ poetry run flatpak-builder-lint --help After making changes to the code or any dependencies run `poetry lock --no-update` to regenerate the lockfile (when adding or changing dependency versions) and `poetry install --sync` to -synchronise the virtual environment. +synchronise the virtual environment. The virtual enviroment can be +removed with `poetry env remove flatpak-builder-lint-xxxxxxxx-py3.xx` +(check the environment name with `poetry env list`). The following Python dependencies are needed to run `jsonschema^4.19.1, requests^2.32.2, requests-cache^1.2.1, lxml^5.2.2, @@ -89,6 +91,16 @@ poetry run ruff check --fix . poetry run mypy . ``` +A pre-commit hook is provided to automate the formatting and linting: + +``` +poetry run pre-commit install +poetry run pre-commit run --all-files + +#Uninstall hooks +poetry run pre-commit uninstall +``` + [Pytest](https://docs.pytest.org/en/stable/getting-started.html) is used to run tests: