-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
projects: warn on "global" assign of plugs and slots
This commit adds a warning (via emit.message()) when a snapcraft.yaml project has top-level plugs and/or slots that are used for assignment and not per-plug/slot configuration. Thanks to lucyllewy for suggested wording of the warning.
- Loading branch information
Showing
5 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Implicit plug assignment in 'desktop' and 'desktop-legacy'. Plugs should be assigned to the app that they apply, and not implicitly assigned via the global 'plugs:' stanza which is intended for configuration only. | ||
(Reference: https://snapcraft.io/docs/snapcraft-interfaces) | ||
Implicit slot assignment in 'network' and 'opengl'. Slots should be assigned to the app that they apply, and not implicitly assigned via the global 'slots:' stanza which is intended for configuration only. | ||
(Reference: https://snapcraft.io/docs/snapcraft-interfaces) | ||
Initializing parts lifecycle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: plugs-warn | ||
base: core22 | ||
version: '0.1' | ||
summary: Check warnings for top-level enabling of slots and plugs | ||
description: Check warnings for top-level enabling of slots and plugs. | ||
|
||
grade: stable | ||
confinement: strict | ||
|
||
plugs: | ||
desktop: | ||
desktop-legacy: | ||
|
||
slots: | ||
network: | ||
opengl: | ||
|
||
parts: | ||
my-part: | ||
plugin: nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
summary: Check warnings for top-level enabling of slots and plugs | ||
|
||
restore: | | ||
snapcraft clean --destructive-mode | ||
rm -f ./*.snap | ||
execute: | | ||
expected_output=`cat expected_output.txt` | ||
snapcraft pull -v --destructive-mode | MATCH "$expected_output" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters