From cb422c60c94000b2a4b545af82f9b46b0a47632b Mon Sep 17 00:00:00 2001 From: bbhtt Date: Thu, 17 Oct 2024 08:05:53 +0530 Subject: [PATCH] Update readme and change some help strings --- README.md | 42 ++++++++++++++++++++----------------- flatpak_builder_lint/cli.py | 2 +- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 900b36dc..e00ecba7 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,40 @@ # flatpak-builder-lint -flatpak-builder-lint is a linter for flatpak-builder manifests, and more widely, -also Flatpak builds. It is primarily developed for Flathub, but can be useful -for other Flatpak repositories. +flatpak-builder-lint is a linter for Flatpak artifacts like Flatpak +manifests, Flatpak Builder builds and repos. It is primarily developed +for Flathub, but can be useful for general use as well. ## Checks -There are four checks available right now - the `manifest` check, the -`builddir` check, the `repo` check and the `appstream` check. +There are four checks available right now - the `appstream` check, the +`manifest` check, the `builddir` check and the `repo` check. The manifest +and the repo checks are run on Flathub infrastructure. -- The `manifest` check expects a [Flatpak manifest](https://docs.flatpak.org/en/latest/manifests.html) +- The `appstream` check expects path to a [Metainfo file](https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/#path-and-filename) as input. -- The `appstream` check expects a [Metainfo file](https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines/#path-and-filename) +- The `manifest` check expects path to a [Flatpak manifest](https://docs.flatpak.org/en/latest/manifests.html) as input. -- The `builddir` check expects a build directory generated by Flatpak - Builder as input. -- The `repo` check expects an OSTree repository exported by Flatpak - Builder as input. +- The `builddir` check expects path to a build directory generated by + Flatpak Builder as input. +- The `repo` check expects path to an OSTree repository exported by + Flatpak Builder as input. The last two are created when [building the application](https://docs.flathub.org/docs/for-app-authors/submission#build-and-install) with the proper arguments to Flatpak Builder. Some checks may require network connectivity. +Errors can be overidden through exceptions. Exceptions must be [submitted +to Flathub](https://docs.flathub.org/docs/for-app-authors/linter#exceptions). + ## Installation -The only supported ways to install and use it are Flatpak and Docker. +The only supported ways to install and use are Flatpak and Docker. ### Flatpak flatpak-builder-lint is part of the `org.flatpak.Builder` flatpak package -available on Flathub. [Set up Flatpak][flatpak_setup] first, then install +available on Flathub. [Set up FlatHub][flatpak_setup] first, then install `org.flatpak.Builder`: ```bash @@ -114,8 +118,7 @@ poetry run flatpak-builder-lint --help After making changes to any dependencies run `poetry lock --no-update` to regenerate the lockfile and -`poetry install --sync` to synchronise the virtual environment when -chaning code or dependencies. +`poetry install --sync` to synchronise the virtual environment. The virtual enviroment can be listed with `poetry env list` and removed with `poetry env remove flatpak-builder-lint-xxxxxxxx-py3.xx`. @@ -123,7 +126,8 @@ with `poetry env remove flatpak-builder-lint-xxxxxxxx-py3.xx`. The following Python dependencies are installed by Poetry and needed to run `jsonschema^4.19.1, requests^2.32.2, requests-cache^1.2.1, lxml^5.2.2, sentry-sdk^2.8.0, PyGObject^3.48.2`. Additionally `poetry-core>=1.0.0` -is necessary to build. +is necessary to build. `poetry-dynamic-versioning` is used to generate +a version from the git commit, since no tags or releases are done. [Ruff](https://docs.astral.sh/ruff/installation/) is used to lint and format code. [MyPy](https://mypy.readthedocs.io/en/stable/getting_started.html) @@ -161,8 +165,8 @@ poetry run pytest -v tests ``` An additional Flat manager test can be run when modifying code relying -on the flatmanager check. The check is meant to be run on CI and not -locally. If it is being run locally it must be run from the root of the +on the flatmanager check. The test is meant to be run on CI and not +locally. If it is being run locally, it must be run from the root of the git repository using ```sh @@ -194,7 +198,7 @@ options: --version Show the version number and exit --exceptions Skip warnings or errors added to exceptions. - Exceptions must be submitted to Flathub or be available in exceptions.json locally + Exceptions must be submitted to Flathub --appid APPID Override the app ID --cwd Override the path parameter with current working directory --ref REF Override the primary ref detection diff --git a/flatpak_builder_lint/cli.py b/flatpak_builder_lint/cli.py index 565d1a48..e3a6f135 100644 --- a/flatpak_builder_lint/cli.py +++ b/flatpak_builder_lint/cli.py @@ -157,7 +157,7 @@ def main() -> int: "--exceptions", help=textwrap.dedent(""" Skip warnings or errors added to exceptions. - Exceptions must be submitted to Flathub or be available in exceptions.json locally + Exceptions must be submitted to Flathub """), action="store_true", )