From 9e4b2fea1a37c3794e1dd00242554a08b9c98fd5 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Wed, 8 Apr 2026 17:32:32 -0400 Subject: [PATCH 01/11] add new error message --- styles/Canonical/019-no-google-drive-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles/Canonical/019-no-google-drive-images.yml b/styles/Canonical/019-no-google-drive-images.yml index 2a5d905..e71f2c6 100644 --- a/styles/Canonical/019-no-google-drive-images.yml +++ b/styles/Canonical/019-no-google-drive-images.yml @@ -1,7 +1,7 @@ # 19 - No Google Drive links extends: existence -message: "Don't use images from Google Drive. Use the asset manager." +message: "Don't use images from Google Drive or the asset manager. Store images in the repository." scope: raw nonword: true level: error From 7400a340f5fe7073c6af62b1a6fcf9fe19d32e45 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Fri, 10 Apr 2026 11:58:13 -0400 Subject: [PATCH 02/11] extend rule 019 to flag asset manager image links --- styles/Canonical/019-no-google-drive-images.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/styles/Canonical/019-no-google-drive-images.yml b/styles/Canonical/019-no-google-drive-images.yml index e71f2c6..e360239 100644 --- a/styles/Canonical/019-no-google-drive-images.yml +++ b/styles/Canonical/019-no-google-drive-images.yml @@ -12,4 +12,7 @@ tokens: - '{figure}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - '\.\. image::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - '\.\. figure::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' + - '!\[[^\n]*\]\([^\n]*assets\.ubuntu[^\n]*\)' + - '\.\. (image|figure)::[^\n]+assets\.ubuntu' + - '(:::|```+)\{(image|figure)\}[^\n]+assets\.ubuntu' From f6885cc01275cf956583d4135ae5f70b7310e404 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Fri, 10 Apr 2026 12:26:52 -0400 Subject: [PATCH 03/11] change rule name --- ...19-no-google-drive-images.yml => 019-no-external-images.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename styles/Canonical/{019-no-google-drive-images.yml => 019-no-external-images.yml} (96%) diff --git a/styles/Canonical/019-no-google-drive-images.yml b/styles/Canonical/019-no-external-images.yml similarity index 96% rename from styles/Canonical/019-no-google-drive-images.yml rename to styles/Canonical/019-no-external-images.yml index e360239..5b1f717 100644 --- a/styles/Canonical/019-no-google-drive-images.yml +++ b/styles/Canonical/019-no-external-images.yml @@ -1,4 +1,4 @@ -# 19 - No Google Drive links +# 19 - No external images extends: existence message: "Don't use images from Google Drive or the asset manager. Store images in the repository." From f4020651cc98efedb3e67b5fe5a6795800a5187e Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Fri, 10 Apr 2026 12:42:46 -0400 Subject: [PATCH 04/11] add test cases for the rule --- tests/data/manifest.yml | 95 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 87 insertions(+), 8 deletions(-) diff --git a/tests/data/manifest.yml b/tests/data/manifest.yml index 5c7932b..549fe80 100644 --- a/tests/data/manifest.yml +++ b/tests/data/manifest.yml @@ -416,14 +416,93 @@ rules: let value = 10; // Initialize value severity: suggestion # For 017, see the end of this file, as the content is long. - # 019-no-google-drive-images: - # cases: - # - id: valid - # filetypes: [md, rst] - # content: - # expect: - # triggers: - # severity: + 019-no-external-images: + cases: + # Google Drive + - id: valid + filetypes: [md] + content: "![alt](https://drive.google.com/file/d/abc123)" + expect: + triggers: 1 + severity: error + - id: valid + filetypes: [rst] + content: ".. image:: https://drive.google.com/file/d/abc123" + expect: + triggers: 1 + severity: error + - id: valid + filetypes: [rst] + content: ".. figure:: https://drive.google.com/file/d/abc123" + expect: + triggers: 1 + severity: error + # Asset manager - Markdown + - id: valid + filetypes: [md] + content: "![alt](https://assets.ubuntu.com/v1/abc123)" + expect: + triggers: 1 + severity: error + # Asset manager - RST image + - id: valid + filetypes: [rst] + content: ".. image:: https://assets.ubuntu.com/v1/abc123" + expect: + triggers: 1 + severity: error + # Asset manager - RST figure + - id: valid + filetypes: [rst] + content: ".. figure:: https://assets.ubuntu.com/v1/abc123" + expect: + triggers: 1 + severity: error + # Asset manager - MyST with backticks + - id: valid + filetypes: [md] + content: "```{image} https://assets.ubuntu.com/v1/abc123" + expect: + triggers: 1 + severity: error + # Asset manager - MyST with colons + - id: valid + filetypes: [md] + content: ":::{image} https://assets.ubuntu.com/v1/abc123" + expect: + triggers: 1 + severity: error + # Asset manager - MyST figure with backticks + - id: valid + filetypes: [md] + content: "```{figure} https://assets.ubuntu.com/v1/abc123" + expect: + triggers: 1 + severity: error + # Asset manager - MyST figure with colons + - id: valid + filetypes: [md] + content: ":::{figure} https://assets.ubuntu.com/v1/abc123" + expect: + triggers: 1 + severity: error + # Should NOT trigger - local repo images + - id: invalid + filetypes: [md] + content: "![alt](images/local-image.png)" + expect: + triggers: 0 + - id: invalid + filetypes: [rst] + content: ".. image:: images/local-image.png" + expect: + triggers: 0 + - id: invalid + filetypes: [md] + content: "```{image} images/local-image.png" + expect: + triggers: 0 + 025a-latinisms-with-english-equivalents: cases: - id: latin-terms-with-substitutions From 76ca731861d24f135dc178dcc4193518b7279421 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Fri, 10 Apr 2026 12:53:34 -0400 Subject: [PATCH 05/11] create test file --- test-019.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test-019.md diff --git a/test-019.md b/test-019.md new file mode 100644 index 0000000..72e1279 --- /dev/null +++ b/test-019.md @@ -0,0 +1,6 @@ +# Testing rule 019 - No external images + +![alt](https://assets.ubuntu.com/v1/abc123) +![alt](https://drive.google.com/file/d/abc123) + +![alt](images/local-image.png) \ No newline at end of file From f89235a255df405925a78170e74ebe1704ce1a83 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Fri, 10 Apr 2026 12:59:10 -0400 Subject: [PATCH 06/11] modify vale ini to test rule --- vale.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vale.ini b/vale.ini index 6c9da08..f595477 100644 --- a/vale.ini +++ b/vale.ini @@ -4,7 +4,8 @@ Vocab = Canonical IgnoredClasses = woke-ignore, vale-ignore [*.{md,txt,rst,html}] -BasedOnStyles = Canonical +; BasedOnStyles = Canonical +Canonical.019-no-external-images = YES # this enumerates all of the current rules with their suggested # severity level. This makes it easier to edit for specific use cases From 3a777a50d190f26e83b7b04922ccb20ecf7f1e74 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Fri, 10 Apr 2026 15:25:21 -0400 Subject: [PATCH 07/11] fix manifest triggers --- tests/data/manifest.yml | 46 +++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/tests/data/manifest.yml b/tests/data/manifest.yml index 549fe80..812d4ee 100644 --- a/tests/data/manifest.yml +++ b/tests/data/manifest.yml @@ -423,85 +423,105 @@ rules: filetypes: [md] content: "![alt](https://drive.google.com/file/d/abc123)" expect: - triggers: 1 + triggers: + - "![alt](https://drive.google.com/file/d/abc123)" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" - id: valid filetypes: [rst] content: ".. image:: https://drive.google.com/file/d/abc123" expect: - triggers: 1 + triggers: + - ".. image:: https://drive.google.com/file/d/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" - id: valid filetypes: [rst] content: ".. figure:: https://drive.google.com/file/d/abc123" expect: - triggers: 1 + triggers: + - ".. figure:: https://drive.google.com/file/d/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Asset manager - Markdown - id: valid filetypes: [md] content: "![alt](https://assets.ubuntu.com/v1/abc123)" expect: - triggers: 1 + triggers: + - "![alt](https://assets.ubuntu.com/v1/abc123)" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Asset manager - RST image - id: valid filetypes: [rst] content: ".. image:: https://assets.ubuntu.com/v1/abc123" expect: - triggers: 1 + triggers: + - ".. image:: https://assets.ubuntu.com/v1/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Asset manager - RST figure - id: valid filetypes: [rst] content: ".. figure:: https://assets.ubuntu.com/v1/abc123" expect: - triggers: 1 + triggers: + - ".. figure:: https://assets.ubuntu.com/v1/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Asset manager - MyST with backticks - id: valid filetypes: [md] content: "```{image} https://assets.ubuntu.com/v1/abc123" expect: - triggers: 1 + triggers: + - "```{image} https://assets.ubuntu.com/v1/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Asset manager - MyST with colons - id: valid filetypes: [md] content: ":::{image} https://assets.ubuntu.com/v1/abc123" expect: - triggers: 1 + triggers: + - ":::{image} https://assets.ubuntu.com/v1/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Asset manager - MyST figure with backticks - id: valid filetypes: [md] content: "```{figure} https://assets.ubuntu.com/v1/abc123" expect: - triggers: 1 + triggers: + - "```{figure} https://assets.ubuntu.com/v1/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Asset manager - MyST figure with colons - id: valid filetypes: [md] content: ":::{figure} https://assets.ubuntu.com/v1/abc123" expect: - triggers: 1 + triggers: + - ":::{figure} https://assets.ubuntu.com/v1/abc123" severity: error + message_regex: "Don't use images from Google Drive or the asset manager" # Should NOT trigger - local repo images - id: invalid filetypes: [md] content: "![alt](images/local-image.png)" expect: - triggers: 0 + triggers: [] - id: invalid filetypes: [rst] content: ".. image:: images/local-image.png" expect: - triggers: 0 + triggers: [] - id: invalid filetypes: [md] content: "```{image} images/local-image.png" expect: - triggers: 0 + triggers: [] 025a-latinisms-with-english-equivalents: cases: From 2ef811369518b5d7521823eecc40d3ae427d4f29 Mon Sep 17 00:00:00 2001 From: Sara Date: Tue, 14 Apr 2026 09:33:44 -0400 Subject: [PATCH 08/11] Apply suggestion from @SecondSkoll Co-authored-by: Michael Park --- vale.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vale.ini b/vale.ini index f595477..6c9da08 100644 --- a/vale.ini +++ b/vale.ini @@ -4,8 +4,7 @@ Vocab = Canonical IgnoredClasses = woke-ignore, vale-ignore [*.{md,txt,rst,html}] -; BasedOnStyles = Canonical -Canonical.019-no-external-images = YES +BasedOnStyles = Canonical # this enumerates all of the current rules with their suggested # severity level. This makes it easier to edit for specific use cases From 189d004af0983467d982c290ae2c8ef98c719626 Mon Sep 17 00:00:00 2001 From: Sara Date: Tue, 14 Apr 2026 09:34:57 -0400 Subject: [PATCH 09/11] Change rule severity Co-authored-by: Michael Park --- vale.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vale.ini b/vale.ini index 6c9da08..0e24831 100644 --- a/vale.ini +++ b/vale.ini @@ -25,7 +25,7 @@ Canonical.015-No-prompts-in-comments = warning Canonical.016-No-inline-comments = suggestion Canonical.017a-Suggest-code-over-25-lines = suggestion Canonical.017b-Warn-code-over-35-lines = warning -Canonical.019-no-google-drive-images = error +Canonical.019-no-external-images = error Canonical.025a-latinisms-with-english-equivalents = suggestion Canonical.025b-latinisms-to-reconsider = suggestion Canonical.025c-latinisms-to-avoid = suggestion From 42db23d99b3ea5865516df4681104b4c4e9397c6 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Tue, 14 Apr 2026 09:42:01 -0400 Subject: [PATCH 10/11] fix manifest and rule files --- styles/Canonical/019-no-external-images.yml | 17 ++++---- test-019.md | 6 --- tests/data/manifest.yml | 45 ++++++--------------- 3 files changed, 20 insertions(+), 48 deletions(-) delete mode 100644 test-019.md diff --git a/styles/Canonical/019-no-external-images.yml b/styles/Canonical/019-no-external-images.yml index 5b1f717..90ee35a 100644 --- a/styles/Canonical/019-no-external-images.yml +++ b/styles/Canonical/019-no-external-images.yml @@ -6,13 +6,10 @@ scope: raw nonword: true level: error tokens: - - '!\[[^\n]*\]\([\w\.:\/\-=\? \"]+(drive.google|drive.usercontent.google)[\w\.:\/\-=\? \"]+\)' - - '<[\w\.:\/-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+>' - - '{image}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '{figure}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '\.\. image::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '\.\. figure::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '!\[[^\n]*\]\([^\n]*assets\.ubuntu[^\n]*\)' - - '\.\. (image|figure)::[^\n]+assets\.ubuntu' - - '(:::|```+)\{(image|figure)\}[^\n]+assets\.ubuntu' - + - '!\[[^\n]*\]\([\w\.:\/\-=\? \"]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=\? \"]+\)' + - '<[\w\.:\/-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+>' + - '{image}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + - '{figure}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + - '\.\. image::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + - '\.\. figure::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + \ No newline at end of file diff --git a/test-019.md b/test-019.md deleted file mode 100644 index 72e1279..0000000 --- a/test-019.md +++ /dev/null @@ -1,6 +0,0 @@ -# Testing rule 019 - No external images - -![alt](https://assets.ubuntu.com/v1/abc123) -![alt](https://drive.google.com/file/d/abc123) - -![alt](images/local-image.png) \ No newline at end of file diff --git a/tests/data/manifest.yml b/tests/data/manifest.yml index 812d4ee..9fbe085 100644 --- a/tests/data/manifest.yml +++ b/tests/data/manifest.yml @@ -418,106 +418,87 @@ rules: # For 017, see the end of this file, as the content is long. 019-no-external-images: cases: - # Google Drive - - id: valid + - id: google-drive-md filetypes: [md] content: "![alt](https://drive.google.com/file/d/abc123)" expect: triggers: - "![alt](https://drive.google.com/file/d/abc123)" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - - id: valid + - id: google-drive-rst-image filetypes: [rst] content: ".. image:: https://drive.google.com/file/d/abc123" expect: triggers: - ".. image:: https://drive.google.com/file/d/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - - id: valid + - id: google-drive-rst-figure filetypes: [rst] content: ".. figure:: https://drive.google.com/file/d/abc123" expect: triggers: - ".. figure:: https://drive.google.com/file/d/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - Markdown - - id: valid + - id: asset-manager-md filetypes: [md] content: "![alt](https://assets.ubuntu.com/v1/abc123)" expect: triggers: - "![alt](https://assets.ubuntu.com/v1/abc123)" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - RST image - - id: valid + - id: asset-manager-rst-image filetypes: [rst] content: ".. image:: https://assets.ubuntu.com/v1/abc123" expect: triggers: - ".. image:: https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - RST figure - - id: valid + - id: asset-manager-rst-figure filetypes: [rst] content: ".. figure:: https://assets.ubuntu.com/v1/abc123" expect: triggers: - ".. figure:: https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST with backticks - - id: valid + - id: asset-manager-myst-backtick-image filetypes: [md] content: "```{image} https://assets.ubuntu.com/v1/abc123" expect: triggers: - "```{image} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST with colons - - id: valid + - id: asset-manager-myst-colon-image filetypes: [md] content: ":::{image} https://assets.ubuntu.com/v1/abc123" expect: triggers: - ":::{image} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST figure with backticks - - id: valid + - id: asset-manager-myst-backtick-figure filetypes: [md] content: "```{figure} https://assets.ubuntu.com/v1/abc123" expect: triggers: - "```{figure} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST figure with colons - - id: valid + - id: asset-manager-myst-colon-figure filetypes: [md] content: ":::{figure} https://assets.ubuntu.com/v1/abc123" expect: triggers: - ":::{figure} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Should NOT trigger - local repo images - - id: invalid + - id: local-image-md filetypes: [md] content: "![alt](images/local-image.png)" expect: triggers: [] - - id: invalid + - id: local-image-rst filetypes: [rst] content: ".. image:: images/local-image.png" expect: triggers: [] - - id: invalid + - id: local-image-myst filetypes: [md] content: "```{image} images/local-image.png" expect: From 78c760347669bf2bd709c8336b40194dbef36a04 Mon Sep 17 00:00:00 2001 From: sefeijoo Date: Tue, 14 Apr 2026 09:42:01 -0400 Subject: [PATCH 11/11] fix manifest and rule files --- styles/Canonical/019-no-external-images.yml | 17 +++---- test-019.md | 6 --- tests/data/manifest.yml | 53 +++++++-------------- 3 files changed, 24 insertions(+), 52 deletions(-) delete mode 100644 test-019.md diff --git a/styles/Canonical/019-no-external-images.yml b/styles/Canonical/019-no-external-images.yml index 5b1f717..90ee35a 100644 --- a/styles/Canonical/019-no-external-images.yml +++ b/styles/Canonical/019-no-external-images.yml @@ -6,13 +6,10 @@ scope: raw nonword: true level: error tokens: - - '!\[[^\n]*\]\([\w\.:\/\-=\? \"]+(drive.google|drive.usercontent.google)[\w\.:\/\-=\? \"]+\)' - - '<[\w\.:\/-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+>' - - '{image}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '{figure}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '\.\. image::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '\.\. figure::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google)[\w\.:\/\-=? "]+' - - '!\[[^\n]*\]\([^\n]*assets\.ubuntu[^\n]*\)' - - '\.\. (image|figure)::[^\n]+assets\.ubuntu' - - '(:::|```+)\{(image|figure)\}[^\n]+assets\.ubuntu' - + - '!\[[^\n]*\]\([\w\.:\/\-=\? \"]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=\? \"]+\)' + - '<[\w\.:\/-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+>' + - '{image}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + - '{figure}[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + - '\.\. image::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + - '\.\. figure::[\w\.:\/\-=? "]+(drive.google|drive.usercontent.google|assets.ubuntu)[\w\.:\/\-=? "]+' + \ No newline at end of file diff --git a/test-019.md b/test-019.md deleted file mode 100644 index 72e1279..0000000 --- a/test-019.md +++ /dev/null @@ -1,6 +0,0 @@ -# Testing rule 019 - No external images - -![alt](https://assets.ubuntu.com/v1/abc123) -![alt](https://drive.google.com/file/d/abc123) - -![alt](images/local-image.png) \ No newline at end of file diff --git a/tests/data/manifest.yml b/tests/data/manifest.yml index 812d4ee..f341393 100644 --- a/tests/data/manifest.yml +++ b/tests/data/manifest.yml @@ -418,106 +418,87 @@ rules: # For 017, see the end of this file, as the content is long. 019-no-external-images: cases: - # Google Drive - - id: valid + - id: google-drive-md filetypes: [md] content: "![alt](https://drive.google.com/file/d/abc123)" expect: triggers: - "![alt](https://drive.google.com/file/d/abc123)" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - - id: valid + - id: google-drive-rst-image filetypes: [rst] content: ".. image:: https://drive.google.com/file/d/abc123" expect: triggers: - ".. image:: https://drive.google.com/file/d/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - - id: valid + - id: google-drive-rst-figure filetypes: [rst] content: ".. figure:: https://drive.google.com/file/d/abc123" expect: triggers: - ".. figure:: https://drive.google.com/file/d/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - Markdown - - id: valid + - id: asset-manager-md filetypes: [md] content: "![alt](https://assets.ubuntu.com/v1/abc123)" expect: triggers: - "![alt](https://assets.ubuntu.com/v1/abc123)" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - RST image - - id: valid + - id: asset-manager-rst-image filetypes: [rst] content: ".. image:: https://assets.ubuntu.com/v1/abc123" expect: triggers: - ".. image:: https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - RST figure - - id: valid + - id: asset-manager-rst-figure filetypes: [rst] content: ".. figure:: https://assets.ubuntu.com/v1/abc123" expect: triggers: - ".. figure:: https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST with backticks - - id: valid + - id: asset-manager-myst-backtick-image filetypes: [md] content: "```{image} https://assets.ubuntu.com/v1/abc123" expect: triggers: - - "```{image} https://assets.ubuntu.com/v1/abc123" + - "{image} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST with colons - - id: valid + - id: asset-manager-myst-colon-image filetypes: [md] content: ":::{image} https://assets.ubuntu.com/v1/abc123" expect: triggers: - - ":::{image} https://assets.ubuntu.com/v1/abc123" + - "{image} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST figure with backticks - - id: valid + - id: asset-manager-myst-backtick-figure filetypes: [md] content: "```{figure} https://assets.ubuntu.com/v1/abc123" expect: triggers: - - "```{figure} https://assets.ubuntu.com/v1/abc123" + - "{figure} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Asset manager - MyST figure with colons - - id: valid + - id: asset-manager-myst-colon-figure filetypes: [md] content: ":::{figure} https://assets.ubuntu.com/v1/abc123" expect: triggers: - - ":::{figure} https://assets.ubuntu.com/v1/abc123" + - "{figure} https://assets.ubuntu.com/v1/abc123" severity: error - message_regex: "Don't use images from Google Drive or the asset manager" - # Should NOT trigger - local repo images - - id: invalid + - id: local-image-md filetypes: [md] content: "![alt](images/local-image.png)" expect: triggers: [] - - id: invalid + - id: local-image-rst filetypes: [rst] content: ".. image:: images/local-image.png" expect: triggers: [] - - id: invalid + - id: local-image-myst filetypes: [md] content: "```{image} images/local-image.png" expect: