Skip to content

Commit

Permalink
Promote finish-args-contains-both-x11-and-wayland to error
Browse files Browse the repository at this point in the history
See #414
  • Loading branch information
bbhtt committed Jul 4, 2024
1 parent 07cd23a commit 6202a49
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion flatpak_builder_lint/checks/finish_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _validate(self, appid: Optional[str], finish_args: dict[str, Set[str]]) -> N
self.warnings.add("finish-args-contains-both-x11-and-fallback")

if "x11" in finish_args["socket"] and "wayland" in finish_args["socket"]:
self.warnings.add("finish-args-contains-both-x11-and-wayland")
self.errors.add("finish-args-contains-both-x11-and-wayland")

if "x11" in finish_args["socket"] or "fallback-x11" in finish_args["socket"]:
if "ipc" not in finish_args["share"]:
Expand Down
7 changes: 0 additions & 7 deletions tests/manifests/display-supported1.json

This file was deleted.

7 changes: 7 additions & 0 deletions tests/manifests/finish_args-wayland-x11.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app-id": "org.flathub.finish_args",
"finish-args": [
"--socket=wayland",
"--socket=x11"
]
}
9 changes: 7 additions & 2 deletions tests/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def test_manifest_finish_args() -> None:
}

warnings = {
"finish-args-contains-both-x11-and-wayland",
"finish-args-x11-without-ipc",
"finish-args-redundant-device-all",
"finish-args-contains-both-x11-and-fallback",
Expand All @@ -177,6 +176,12 @@ def test_manifest_finish_args() -> None:
assert a not in found_errors


def test_manifest_finish_args_issue_wayland_x11() -> None:
ret = run_checks("tests/manifests/finish_args-wayland-x11.json")
found_errors = set(ret["errors"])
assert "finish-args-contains-both-x11-and-wayland" in found_errors


def test_manifest_finish_args_issue_33() -> None:
ret = run_checks("tests/manifests/own_name_substring.json")
found_errors = set(ret["errors"])
Expand Down Expand Up @@ -219,10 +224,10 @@ def test_manifest_display_stuff() -> None:
absents = {
"finish-args-fallback-x11-without-wayland",
"finish-args-only-wayland",
"finish-args-contains-both-x11-and-wayland",
}

for file in (
"display-supported1.json",
"display-supported2.json",
"display-supported3.json",
):
Expand Down

0 comments on commit 6202a49

Please sign in to comment.