Skip to content

Commit

Permalink
Update readme and change some help strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bbhtt committed Oct 17, 2024
1 parent 7aa2300 commit cb422c6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
42 changes: 23 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -114,16 +118,16 @@ 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`.

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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion flatpak_builder_lint/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down

0 comments on commit cb422c6

Please sign in to comment.