From 9683edaef2af9f9a7a17336081c78b436df6aba0 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Fri, 25 Sep 2026 15:48:32 +0200 Subject: [PATCH 1/7] doc(spec): define shared value validation rules --- docs/standard/index.rst | 111 +++++++++++++++++--------------- docs/standard/types.rst | 129 +++++++++++++++++++++++++++++--------- pyproject.toml | 1 + scripts/check-examples.py | 34 +++++++--- tests/test_examples.py | 34 ++++++++++ uv.lock | 46 +++++++++++++- 6 files changed, 266 insertions(+), 89 deletions(-) diff --git a/docs/standard/index.rst b/docs/standard/index.rst index 84f97aa8..a3fbf0d8 100644 --- a/docs/standard/index.rst +++ b/docs/standard/index.rst @@ -41,6 +41,12 @@ A key marked *(required)* MUST be present. Within an optional section, required keys MUST be present if you include that section. Other keys are optional unless their descriptions state a condition. +A key MUST NOT have a null value. Omit an optional key if you have +no value for it. A file MUST NOT contain keys this specification +does not define. + +Every value follows the rules of its :doc:`type `. + Specification ------------- @@ -49,7 +55,7 @@ Specification .. rst-class:: key-meta -string +:ref:`string ` The version of the specification the file follows: ``"1"``. @@ -60,7 +66,7 @@ The version of the specification the file follows: ``"1"``. .. rst-class:: key-meta -string +:ref:`string ` .. code-block:: yaml :caption: Example @@ -85,8 +91,8 @@ The short public name of the software, the one users know it by. The URL of the source code repository (git, svn and so on) where the software is published. It is also the unique identifier of the -software. If the repository is reachable over several protocols, -prefer HTTPS. +software. Any scheme is allowed. If the repository is reachable over +several protocols, prefer HTTPS. .. tip:: @@ -126,7 +132,7 @@ Allowed values: .. rst-class:: key-meta key-meta-union -:meta-type:`enumerated string ` or :meta-type:`array of strings` +:meta-type:`enumerated string ` or :meta-type:`array ` of :meta-type:`strings ` Values: ``web``, ``windows``, ``mac``, ``linux``, ``ios``, ``android``. When none of them fits, another human readable value @@ -188,7 +194,7 @@ In the key names below, ``[lang]`` stands for that tag. .. rst-class:: key-meta -string +:ref:`string ` .. code-block:: yaml :caption: Example @@ -205,7 +211,7 @@ it differs from :ref:`name `. .. rst-class:: key-meta -string (max 150 chars) +:ref:`string ` (max 150 chars) .. code-block:: yaml :caption: Example @@ -222,7 +228,7 @@ single sentence, maximum 150 characters. .. rst-class:: key-meta -string (min 150 chars, max 10000 chars) +:ref:`string ` (min 150 chars, max 10000 chars) .. rst-class:: key-condition @@ -233,10 +239,10 @@ characters, giving potential users an overview of what it can do. Write it for users, not developers: it is the text that would present the software on its website. -The value of this key is Markdown, as defined by -`CommonMark `__. Keep the formatting basic: -``*italic*``, ``**bold**``, bullet points and ``[links](#)``, since -consumers MAY render only this subset. +The value MAY contain line breaks and uses Markdown as defined by +`CommonMark `__. Consumers MAY support only +``*italic*``, ``**bold**``, bullet points and ``[links](#)``. Use these +formats to keep the description readable across catalogs. .. _documentation: @@ -280,7 +286,7 @@ A URL to the hosted API documentation of the software. .. rst-class:: key-meta -array of strings +:ref:`array ` of :ref:`strings ` What users can do with the software. Write the list for public decision makers who would commission it. @@ -297,7 +303,7 @@ decision makers who would commission it. .. rst-class:: key-meta key-meta-union -:meta-type:`array` of :meta-type:`paths ` or :meta-type:`URLs ` +:meta-type:`array ` of :meta-type:`paths ` or :meta-type:`URLs ` Formats: PNG, JPEG, WebP, AVIF @@ -330,7 +336,7 @@ same repository as ``publiccode.yml``. .. rst-class:: key-meta -array of :ref:`URLs ` +:ref:`array ` of :ref:`URLs ` .. code-block:: yaml :caption: Example @@ -353,7 +359,7 @@ the software's website. .. rst-class:: key-meta -array of strings +:ref:`array ` of :ref:`strings ` A list of awards won by the software. @@ -365,7 +371,7 @@ A list of awards won by the software. .. rst-class:: key-meta -string +:ref:`string ` .. code-block:: yaml :caption: Example @@ -382,7 +388,7 @@ see the `SPDX License List `__. .. rst-class:: key-meta -string +:ref:`string ` .. code-block:: yaml :caption: Example @@ -439,7 +445,7 @@ implementation and policies of each consumer. .. rst-class:: key-meta -string +:ref:`string ` .. code-block:: yaml :caption: Example @@ -486,7 +492,7 @@ Allowed values: .. rst-class:: key-meta -array of :ref:`Contractors ` +:ref:`array ` of :ref:`Contractors ` .. rst-class:: key-condition @@ -501,7 +507,7 @@ companies, organisations or other collective names. .. rst-class:: key-meta -array of :ref:`Contacts ` +:ref:`array ` of :ref:`Contacts ` .. rst-class:: key-condition @@ -525,7 +531,7 @@ is available in. .. rst-class:: key-meta -boolean +:ref:`boolean ` If ``true``, the software supports translation into other languages. It may still be available in one language. @@ -535,7 +541,7 @@ It may still be available in one language. .. rst-class:: key-meta -array of :ref:`language tags ` +:ref:`array ` of :ref:`language tags ` .. code-block:: yaml :caption: Example @@ -574,7 +580,7 @@ same repository as ``publiccode.yml``. .. rst-class:: key-meta -string +:ref:`string ` .. code-block:: yaml :caption: Example @@ -621,7 +627,7 @@ graphical installer, this page can also offer it for download. .. rst-class:: key-meta -string +:ref:`string ` .. code-block:: yaml :caption: Example @@ -637,7 +643,7 @@ related software. .. rst-class:: key-meta -array of :ref:`enumerated strings ` +:ref:`array ` of :ref:`enumerated strings ` Allowed values: see :ref:`categories` @@ -649,24 +655,11 @@ software. .. rst-class:: key-meta -array +:ref:`array ` of objects A list of standards, regulations, frameworks or systems that the software supports or complies with. -Properties of each item: - -- ``id`` (**required**): An identifier for the supported standard, - regulation, framework or system. It is either an alias in - the form ``alias:``, resolved through the - :ref:`list of aliases `, or any other valid :ref:`URI ` referencing the resource - directly. - - An ``alias:`` value MUST exist in the - :ref:`list of aliases `. An unknown alias is an error. - Any other value MUST be a syntactically valid URI. A value that is - well formed but not otherwise known is accepted as is. - .. code-block:: yaml :caption: Example @@ -674,6 +667,23 @@ Properties of each item: - id: alias:gdpr - id: https://eur-lex.europa.eu/eli/reg/2016/679/oj +``supports/id`` *(required)* +'''''''''''''''''''''''''''' + +.. rst-class:: key-meta + +:ref:`URI ` + +An identifier for the supported standard, regulation, framework or +system. It is either an alias in the form ``alias:``, resolved +through the :ref:`list of aliases `, or any other URI +referencing the resource directly. + +An ``alias:`` value MUST exist in the :ref:`list of aliases +`. An unknown alias is an error. Any other value MUST be a +syntactically valid URI. A value that is well formed but not otherwise +known is accepted as is. + .. tip:: Prefer an alias when the list has one: every file then names the @@ -690,7 +700,7 @@ Who the software is for. .. rst-class:: key-meta -array of :ref:`country codes ` +:ref:`array ` of :ref:`country codes ` Countries explicitly included in the intended audience: the software claims compliance with their processes, technologies @@ -701,7 +711,7 @@ or laws. .. rst-class:: key-meta -array of :ref:`country codes ` +:ref:`array ` of :ref:`country codes ` Countries explicitly excluded from the intended audience, for instance when the software conflicts with a law, process or @@ -715,7 +725,7 @@ countries the software targets. .. rst-class:: key-meta -array of :ref:`enumerated strings ` +:ref:`array ` of :ref:`enumerated strings ` Allowed values: see :ref:`scopes` @@ -726,7 +736,7 @@ The sectors the software serves, such as healthcare or education. .. rst-class:: key-meta -array of strings +:ref:`array ` of :ref:`strings ` Names of prominent public administrations using the software, shown as testimonials. @@ -741,7 +751,7 @@ This key is deprecated. .. rst-class:: key-meta -array of :ref:`Organisations ` +:ref:`array ` of :ref:`Organisations ` The organisations known to be funding the development of the software. @@ -761,7 +771,7 @@ A link to a public roadmap of the software. .. rst-class:: key-meta -array of strings +:ref:`array ` of :ref:`strings ` .. code-block:: yaml :caption: Example @@ -770,7 +780,8 @@ array of strings - https://example.com/openfax.git When the software is a fork, the :ref:`url ` of the software it -was forked from, whether or not that has a ``publiccode.yml``. +was forked from, whether or not that has a ``publiccode.yml``. Like +``url``, it allows any scheme. The key marks the software as a fork published as software of its own: see :ref:`forks`. @@ -792,7 +803,7 @@ software. .. rst-class:: key-meta -array of :ref:`Dependencies ` +:ref:`array ` of :ref:`Dependencies ` Runtime dependencies distributed under an open-source license. @@ -805,7 +816,7 @@ documentation and deployment scripts. .. rst-class:: key-meta -array of :ref:`Dependencies ` +:ref:`array ` of :ref:`Dependencies ` Runtime dependencies distributed under a proprietary license. @@ -814,7 +825,7 @@ Runtime dependencies distributed under a proprietary license. .. rst-class:: key-meta -array of :ref:`Dependencies ` +:ref:`array ` of :ref:`Dependencies ` Hardware needed to use the software. diff --git a/docs/standard/types.rst b/docs/standard/types.rst index af7d48d8..11405e79 100644 --- a/docs/standard/types.rst +++ b/docs/standard/types.rst @@ -4,6 +4,46 @@ Types Each key lists its type below its name. Values MUST follow the rules for that type. +.. _string-type: + +String +------ + +A sequence of Unicode characters. Date, Enumerated string, Language +tag, Country code, E-mail address, Path, URI and URL values are +strings and MUST follow these rules too. + +Parsers MUST ignore leading and trailing whitespace. The remaining +value MUST NOT be empty. + +A string MUST NOT contain line breaks, unless its key allows them. + +Count characters after trimming leading and trailing whitespace. +Use the extended grapheme clusters defined in `Unicode Standard +Annex #29 `__. For example, +``é`` counts as one character whether stored as one code point or as +``e`` followed by a combining accent. + +The value MUST be a YAML string: a number, a boolean or null is an +error. + +.. _boolean-type: + +Boolean +------- + +``true`` or ``false``, unquoted. + +.. _array-type: + +Array +----- + +A YAML sequence of values of the same type. + +An array MUST contain at least one item and MUST NOT contain +duplicates. Omit an optional key if you have no items to list. + .. _date-type: Date @@ -13,6 +53,8 @@ A calendar date in the ISO 8601 ``YYYY-MM-DD`` format, the only ISO 8601 format allowed. Quote it in YAML, as in ``"2017-04-15"``, so that it stays a string. +The date MUST exist in the calendar: ``"2023-02-30"`` is not a date. + .. _enumerated-string-type: Enumerated string @@ -20,6 +62,8 @@ Enumerated string A string taking one of the values listed for its key. +Values are case sensitive: write them exactly as listed. + .. _language-tag-type: Language tag @@ -28,6 +72,9 @@ Language tag An IETF `BCP 47 `__ language tag, such as ``en``, ``it`` or ``de-AT``. +As in BCP 47, tags are case insensitive. They SHOULD be written in +their canonical case, as in ``de-AT``. + .. _country-code-type: Country code @@ -37,6 +84,16 @@ An `ISO 3166-1 alpha-2 `__ country code, such as ``IT`` or ``DE``. The code MUST be uppercase. +.. _email-type: + +E-mail address +-------------- + +An e-mail address, in the ``addr-spec`` form of `RFC 5322 +`__, such as +``jane.doe@example.com``. Display names like +``Jane Doe `` are not allowed. + .. _path-type: Path @@ -45,6 +102,9 @@ Path The path of a file in the repository, relative to its root, such as ``img/logo.svg``. +A path MUST NOT start with ``/`` or refer to a file outside the +repository, for example through ``..``. + .. _uri-type: URI @@ -61,6 +121,9 @@ URL An absolute URL, scheme included, such as ``https://example.com/firefax``. +The scheme MUST be ``http`` or ``https``, unless the key allows +others. + .. _contact-type: Contact @@ -68,19 +131,20 @@ Contact Properties: -- ``name`` (**required**): The full name of the technical contact. - It MUST be a real person, not generic contact information, a - company department or an association. -- ``email``: The e-mail address of the technical contact. It MUST - reach the contact directly, not a mailing list or a generic - contact point like ``info@acme.inc``. -- ``phone``: The phone number, as a string in +- ``name`` *(required)*, :ref:`string `: The full name + of the technical contact. It MUST be a real person, not generic + contact information, a company department or an association. +- ``email``, :ref:`e-mail address `: The e-mail address + of the technical contact. It MUST reach the contact directly, not a + mailing list or a generic contact point like ``info@acme.inc``. +- ``phone``, :ref:`string `: The phone number, in `E.164 `_ format. It MUST include the international dialing prefix (e.g. ``+3923113215112``). -- ``affiliation``: The organisation the technical contact works for, - such as a company or an association. With several maintainers, it - tells which maintainer entity each contact belongs to. +- ``affiliation``, :ref:`string `: The organisation the + technical contact works for, such as a company or an association. + With several maintainers, it tells which maintainer entity each + contact belongs to. .. _contractor-type: @@ -89,17 +153,17 @@ Contractor Properties: -- ``name`` (**required**): The name of the contractor, whether it’s a - company or a physical person. -- ``until`` (**required**): The :ref:`date ` the +- ``name`` (**required**), :ref:`string `: The name of the + contractor, whether it’s a company or a physical person. +- ``until`` (**required**), :ref:`date `: The date the maintenance is going to end. For community maintenance, it SHOULD be no more than two years in the future. Update it regularly while the community maintains the software. -- ``email``: The e-mail address of the technical contact. It MUST - reach that person directly, not a mailing list or a generic - contact point like ``info@acme.inc``. -- ``website``: The contractor website: its main institutional site - or a page specific to the project. +- ``email``, :ref:`e-mail address `: The e-mail address + of the technical contact. It MUST reach that person directly, not a + mailing list or a generic contact point like ``info@acme.inc``. +- ``website``, :ref:`URL `: The contractor website: its + main institutional site or a page specific to the project. .. _dependency-type: @@ -108,14 +172,18 @@ Dependency Properties: -- ``name`` (**required**): The name of the dependency (e.g. MySQL, - NFC Reader). -- ``versionMin``: The oldest compatible version. -- ``versionMax``: The newest compatible version. -- ``version``: The only compatible major version, including the - patches and bugfixes released for it later. -- ``optional``: If ``true``, the software also works without the - dependency. Defaults to ``false``. +- ``name`` *(required)*, :ref:`string `: The name of the + dependency (e.g. MySQL, NFC Reader). +- ``versionMin``, :ref:`string `: The oldest compatible + version. +- ``versionMax``, :ref:`string `: The newest compatible + version. +- ``version``, :ref:`string `: The only compatible major + version, including the patches and bugfixes released for it later. + It MUST NOT be present together with ``versionMin`` or + ``versionMax``. +- ``optional``, :ref:`boolean `: If ``true``, the + software also works without the dependency. Defaults to ``false``. Complex versioning ~~~~~~~~~~~~~~~~~~ @@ -152,7 +220,8 @@ association, a company or a public authority. Properties: -- ``name`` (**required**): The name of the organisation, whether - it’s an association, a company, a public sector organisation, or - a physical person. -- ``uri``: The URI identifying the organisation. +- ``name`` *(required)*, :ref:`string `: The name of the + organisation, whether it’s an association, a company, a public + sector organisation or a physical person. +- ``uri``, :ref:`URI `: The URI identifying the + organisation. diff --git a/pyproject.toml b/pyproject.toml index e7738c58..9ddd3dac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,4 +15,5 @@ dependencies = [ [dependency-groups] dev = [ "pyyaml>=6.0.3", + "regex>=2026.11.15", ] diff --git a/scripts/check-examples.py b/scripts/check-examples.py index 80626291..375f2313 100755 --- a/scripts/check-examples.py +++ b/scripts/check-examples.py @@ -1,15 +1,15 @@ #!/usr/bin/env python3 """Check the example files against the keys documented in the spec. -Both examples may use only documented keys, and the full example must -use every one of them, so a key added to the spec without an example -fails the build. The description length limits are checked too. +Both examples may use only documented keys. The full example must +use every key. Also check description lengths and line breaks. """ import re import sys from pathlib import Path +import regex import yaml SPEC = Path("docs/standard/index.rst") @@ -71,24 +71,42 @@ def used_keys(node, prefix=""): return keys +def list_item_keys(node, containers, prefix=""): + """Key paths inside the mappings of lists, like supports/id.""" + keys = set() + for key, value in node.items(): + path = f"{prefix}{key}" + if isinstance(value, dict): + keys |= list_item_keys(value, containers, path + "/") + elif isinstance(value, list) and path in containers: + for item in value: + if isinstance(item, dict): + keys |= {f"{path}/{k}" for k in item} + return keys + + def check_descriptions(name, data): errors = [] for lang, texts in data.get("description", {}).items(): - short = texts.get("shortDescription", "") - if len(short) > 150 or "\n" in short: + short = texts.get("shortDescription", "").strip() + if len(regex.findall(r"\X", short)) > 150 or regex.search(r"\R", short): errors.append(f"{name}: description/{lang}/shortDescription must be one line of at most 150 characters") long = texts.get("longDescription") - if long is not None and not 150 <= len(long) <= 10000: - errors.append(f"{name}: description/{lang}/longDescription is {len(long)} characters, not 150 to 10000") + if long is not None: + length = len(regex.findall(r"\X", long.strip())) + if not 150 <= length <= 10000: + errors.append(f"{name}: description/{lang}/longDescription is {length} characters, not 150 to 10000") return errors def main(): spec = documented_keys() + containers = {key.rsplit("/", 1)[0] for key in spec if "/" in key} errors = [] for path in (MINIMAL, FULL): data = yaml.safe_load(path.read_text()) - used = used_keys(data) + # Typed objects have their properties on the Types page. + used = used_keys(data) | list_item_keys(data, containers) for key in sorted(used - spec): errors.append(f"{path}: {key} is not documented in {SPEC}") if path == FULL: diff --git a/tests/test_examples.py b/tests/test_examples.py index 9418a634..cd5e6128 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -95,3 +95,37 @@ def test_unknown_property_in_minimal_example(self): result, errors = self.check(self.data) self.assertEqual(result, 1) self.assertIn("maintenance/contacts/[]/emali is not documented", errors) + + def test_short_description_counts_graphemes(self): + for character in ("e\u0301", "\U0001f469\u200d\U0001f4bb"): + with self.subTest(character=character): + data = {"description": {"en": {"shortDescription": character * 150}}} + self.assertEqual(checker.check_descriptions("example", data), []) + + def test_long_description_counts_graphemes(self): + data = {"description": {"en": {"longDescription": "e\u0301" * 100}}} + errors = checker.check_descriptions("example", data) + self.assertEqual(len(errors), 1) + self.assertIn("100 characters", errors[0]) + + def test_short_description_ignores_surrounding_whitespace(self): + data = {"description": {"en": {"shortDescription": " " + "a" * 150 + " "}}} + self.assertEqual(checker.check_descriptions("example", data), []) + + def test_short_description_rejects_line_breaks(self): + for line_break in ("\n", "\r", "\u2028"): + with self.subTest(line_break=line_break): + data = {"description": {"en": {"shortDescription": "first" + line_break + "second"}}} + errors = checker.check_descriptions("example", data) + self.assertEqual(len(errors), 1) + self.assertIn("must be one line", errors[0]) + + def test_long_description_ignores_surrounding_whitespace(self): + data = {"description": {"en": {"longDescription": " " + "a" * 149 + "\n"}}} + errors = checker.check_descriptions("example", data) + self.assertEqual(len(errors), 1) + self.assertIn("149 characters", errors[0]) + + +if __name__ == "__main__": + unittest.main() diff --git a/uv.lock b/uv.lock index 6dacf1e5..76d535c1 100644 --- a/uv.lock +++ b/uv.lock @@ -189,6 +189,7 @@ dependencies = [ [package.dev-dependencies] dev = [ { name = "pyyaml" }, + { name = "regex" }, ] [package.metadata] @@ -201,7 +202,10 @@ requires-dist = [ ] [package.metadata.requires-dev] -dev = [{ name = "pyyaml", specifier = ">=6.0.3" }] +dev = [ + { name = "pyyaml", specifier = ">=6.0.3" }, + { name = "regex", specifier = ">=2026.11.15" }, +] [[package]] name = "pygments" @@ -238,6 +242,46 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, ] +[[package]] +name = "regex" +version = "2026.11.15" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cf/e7/67c67920a3b5183388e0853a0a564a4bf60f2dd190a4e7626f5dad2fed62/regex-2026.11.15.tar.gz", hash = "sha256:d6ec7e29e62ebf93ab2a593d1137022b6025497d8610e5cb666d52f9ee5bb0ce", size = 419660, upload-time = "2026-11-15T17:04:15.71Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/ef/62b34ed4d237d668e8fb469b0e5da33cd4b4481f55105f560b64ed516275/regex-2026.11.15-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:b9aff8d89f72818646f192632c8249f3848a23d2c9527360de356d6025c5bcee", size = 498689, upload-time = "2026-11-15T17:02:43.856Z" }, + { url = "https://files.pythonhosted.org/packages/b3/a1/74492e58f68de7ac1521964491580dc3429e066e651baf6d7ad28c879a21/regex-2026.11.15-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:8a194defd67c120d7dfbd8459b9d98057bdcd03a8466b977d4d237a526c053a7", size = 297043, upload-time = "2026-11-15T17:02:45.017Z" }, + { url = "https://files.pythonhosted.org/packages/4e/0f/962bb0eccba12054cd855300339966c3215a066040ef4df1702d6f0db074/regex-2026.11.15-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:42f9f6d0f3698f8b32cfe45b03cbd1830a7c203c9930fe15a1516ab9dda19c36", size = 294390, upload-time = "2026-11-15T17:02:46.196Z" }, + { url = "https://files.pythonhosted.org/packages/7d/01/67786f8b04bdf3881e1222d78bd78a39633604d332c23e4e3f337b78a683/regex-2026.11.15-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:99e61a4f575b3439de59de524bed94d144b22a11877407c81c702ce98fb4e1d3", size = 805574, upload-time = "2026-11-15T17:02:47.439Z" }, + { url = "https://files.pythonhosted.org/packages/1e/52/4e31d7b6fea910b4cb3fb562a0b1aca6a1f0b7fef0fa3d3e0151a4602760/regex-2026.11.15-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:37f839f3a65368314d232376c754eee726ce4a34030c18247c76d238ef0ff249", size = 879653, upload-time = "2026-11-15T17:02:48.933Z" }, + { url = "https://files.pythonhosted.org/packages/7f/9b/7d9ad7a093e3b094030153a8dfc345e503e8416a041d7ef800e5397d04f1/regex-2026.11.15-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:481626b285706374a83f7ce569f2d1a0c640700a569d5ca54dba1d2668e03a04", size = 920146, upload-time = "2026-11-15T17:02:50.373Z" }, + { url = "https://files.pythonhosted.org/packages/d5/00/b40f90b30b5fc7b95ea59af624ec09367d746affb12274b40b6de868776b/regex-2026.11.15-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bbe5efba8a008a2a684173286be44b85b2cfc3427107662440903ccce6ec00d5", size = 808635, upload-time = "2026-11-15T17:02:51.739Z" }, + { url = "https://files.pythonhosted.org/packages/a9/37/45504fcb232284570bdab7275d362ae84334e44438196dd01cb115ca49f5/regex-2026.11.15-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:14feb390805c099e16bf7d37e5f574068eeac59c55336a76d0c1c6f7388b2510", size = 785251, upload-time = "2026-11-15T17:02:53.033Z" }, + { url = "https://files.pythonhosted.org/packages/dd/f9/015bf43465c083fc1c24aa1253ba9b0d729a033c2130a2cf8fbe5e8b4030/regex-2026.11.15-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20fb02e33c0e3c0a265d1b767c359c92d0df9292292c280ff67ace49e3e05467", size = 793506, upload-time = "2026-11-15T17:02:54.423Z" }, + { url = "https://files.pythonhosted.org/packages/91/9a/ee6d3425e890026bdabca30c9bfb1ad07faf914dcebd967496139283e622/regex-2026.11.15-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:3a16f20dcfb68ad67bcc326757facad9b3e922693409c1c8c0deea3869e70669", size = 869637, upload-time = "2026-11-15T17:02:57.605Z" }, + { url = "https://files.pythonhosted.org/packages/3d/56/f54de39dcb85e988edee4e3981452b147017ec6b89f6346abe7622181cd8/regex-2026.11.15-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:8a3cb0651bc61270f3db6f733a277a9c1bea006ab9e0bf17d5a1ae36ea55def6", size = 772072, upload-time = "2026-11-15T17:02:59.089Z" }, + { url = "https://files.pythonhosted.org/packages/0a/f4/81b83ed91ba0642cb725ef1a9193c02f3e1f8d086c6cb92536a52be88a46/regex-2026.11.15-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:119909bbaae76605210572042196de125e261037f915dec273af3b13fae65c06", size = 862121, upload-time = "2026-11-15T17:03:00.613Z" }, + { url = "https://files.pythonhosted.org/packages/96/d6/eeed1f1ee8d3c93d7ca823684eac18a92a4adab60e9b46e465f00b683d2d/regex-2026.11.15-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2388100a73abc2205b22b37f292661bfd1b221be0fde996e5e4f1ad272335471", size = 796821, upload-time = "2026-11-15T17:03:02.113Z" }, + { url = "https://files.pythonhosted.org/packages/7e/e9/59bea0ee2503ea7b92a806894f3e7198a9bf037b9bea27c5b0c0d2993740/regex-2026.11.15-cp314-cp314-win32.whl", hash = "sha256:34fd5add8dedc9b1de724049951e3835afddc21cc43e2741cdce6e1c92b88b81", size = 275373, upload-time = "2026-11-15T17:03:03.243Z" }, + { url = "https://files.pythonhosted.org/packages/7c/08/1b2f18cd1eb40b13e28204f951a2694cc0354f5a4c2a63e11fdad6ae8744/regex-2026.11.15-cp314-cp314-win_amd64.whl", hash = "sha256:1c3c89fbbb08d2f75e36179d27154e867836656a9ab57616aaf8042c089c0d20", size = 284686, upload-time = "2026-11-15T17:03:04.393Z" }, + { url = "https://files.pythonhosted.org/packages/f4/96/dfbb6663234f46adaab592f9d7af952d1fb4186ef49bfce6fcff05dc126e/regex-2026.11.15-cp314-cp314-win_arm64.whl", hash = "sha256:81a0a8a2cecab76abc0fbb4d50f849d004a6128accb32d77109b92e8324d4272", size = 284556, upload-time = "2026-11-15T17:03:05.684Z" }, + { url = "https://files.pythonhosted.org/packages/0e/bd/2bdd6363b294a05a55c573b8e4c4277954fad86a3b68527ff1ada5b52b44/regex-2026.11.15-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:c9d594f5785a4b0b7ad6a949ce8c799c67ee8105a6ffc8b4d5f4fd39f53bb9cb", size = 502519, upload-time = "2026-11-15T17:03:06.946Z" }, + { url = "https://files.pythonhosted.org/packages/dd/fa/bc5d743615f784cc4d11a7f429c8c4038a9c0729e26f95f7544935628cec/regex-2026.11.15-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:0e1cd15586d8afa75a925f1837ad347e61e3d32d9bbe0b0e63edb194b4d718c5", size = 299094, upload-time = "2026-11-15T17:03:08.494Z" }, + { url = "https://files.pythonhosted.org/packages/bc/03/47d1753f3117eaf840c16cde2e39d6a04997f55552416f7447bd9f60f6cf/regex-2026.11.15-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:55db42bd5d8de089e2ab3e5ef48a83c013fa6eb81cc69e3e124556762b61cff3", size = 296908, upload-time = "2026-11-15T17:03:09.965Z" }, + { url = "https://files.pythonhosted.org/packages/dd/35/4998e53259a43a90d6146848072984b0027fae10249a8b4b37b25d70bfdc/regex-2026.11.15-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6dace895669eb1a4e4c02ffa6595fc4f02873de53f88fc21e70d41c4451220a7", size = 821066, upload-time = "2026-11-15T17:03:11.182Z" }, + { url = "https://files.pythonhosted.org/packages/4f/d5/ad0a9e9d9bb22bb2181edaedddd8bf48979748794f8031d308224204e549/regex-2026.11.15-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:66a49a7a63c0d77d0abe20edcc2d9466c8bb7b6a78d77c61871c768d6894f72f", size = 884719, upload-time = "2026-11-15T17:03:13.018Z" }, + { url = "https://files.pythonhosted.org/packages/50/30/23ada23d3a379255a7b7e6a0787d2d3a1b3b5c67aca7421e15f1d10e7d65/regex-2026.11.15-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c2873cc9abe12d0ad55e4ff5b616856c2e1b764f39d58e931038c06b37e5a7f4", size = 924787, upload-time = "2026-11-15T17:03:14.174Z" }, + { url = "https://files.pythonhosted.org/packages/a7/ed/2c6a2707b91345500614247e98164ad73072612c2521b1a50565f9bc1e96/regex-2026.11.15-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:808be73b8fcb4bc9f1996ce0dead2e49aaeee0cd11db0691f7b63eea7c0f8448", size = 825512, upload-time = "2026-11-15T17:03:15.489Z" }, + { url = "https://files.pythonhosted.org/packages/21/14/e25d550e5558482c8c47b2c39f8c6804abe210a60bcc4467fc429d230f87/regex-2026.11.15-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7912578bc32a25cde9648f35ef00e064464792980f43fa0a690501277e33042e", size = 793319, upload-time = "2026-11-15T17:03:17.591Z" }, + { url = "https://files.pythonhosted.org/packages/a0/ff/564d946a9008b06007fad9ac615df01fbeea0a05e87bfe84e6ae4d19f076/regex-2026.11.15-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:befb860301d5c4736e0cdfabbbe2ea5887a7a643594f5e32c59d9a28f94a5f75", size = 808026, upload-time = "2026-11-15T17:03:19.221Z" }, + { url = "https://files.pythonhosted.org/packages/99/de/bfb6f45274c0ff6483a2bee363a3e70f30c07239b53e7e136a3e2b143fd1/regex-2026.11.15-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:cfaf14e2080f5ced2699ebfbd5fd6cede980d331e14b2dc25235480bbd3de61d", size = 871356, upload-time = "2026-11-15T17:03:21.014Z" }, + { url = "https://files.pythonhosted.org/packages/35/84/633294d2a225e3e794df78e12d43dca25d586df31712bb2115721f45987f/regex-2026.11.15-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:958661f35e8f260fea889a9a4b42db0e2756f85971c8f7371d9059cfd1997f70", size = 776893, upload-time = "2026-11-15T17:03:22.365Z" }, + { url = "https://files.pythonhosted.org/packages/b8/26/2435cb56e6357dd6cc08a91e48eac460d400e73bdfd546e81ab9f44d80a1/regex-2026.11.15-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:ca38887219a8b77e56a8ded792a4ca6b0e78138c0ea0817de44022b0f73da3a7", size = 864968, upload-time = "2026-11-15T17:03:23.901Z" }, + { url = "https://files.pythonhosted.org/packages/39/36/307b91f52edc841c26e3b4acdf59c7b7c8ff8ef90159a30cb9b4d0c1f7f0/regex-2026.11.15-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:9fc28a3e2f8a1d6930dcdbefb31a80a82caa86619980f147d5bfeca30eae76b3", size = 812371, upload-time = "2026-11-15T17:03:25.391Z" }, + { url = "https://files.pythonhosted.org/packages/a1/22/18403eb869ffa173802cba7570c284bbd4080f4c7b31d1d0e0fedb24665f/regex-2026.11.15-cp314-cp314t-win32.whl", hash = "sha256:7e0562f26fbe338b614691a3ab7040392b17c5ed1cb26e04032c9c1a874b0040", size = 277471, upload-time = "2026-11-15T17:03:26.708Z" }, + { url = "https://files.pythonhosted.org/packages/12/2a/3419c7ebf95d77458113cc1a297456a9918aed09415556fbb5eb84194550/regex-2026.11.15-cp314-cp314t-win_amd64.whl", hash = "sha256:7ddabafb036132a20a8868637bfade62a98e5edefc574a52a91ce73961bc4e47", size = 287299, upload-time = "2026-11-15T17:03:27.803Z" }, + { url = "https://files.pythonhosted.org/packages/ba/0a/9881ec29eb3ae31fd0377d9035fa472dabab9a0e751f399165fc0cdc4c4b/regex-2026.11.15-cp314-cp314t-win_arm64.whl", hash = "sha256:a99aa9a355ebe33cc7a68e6651c20712f338fa57a8e8cebd782e4208543c3b46", size = 286833, upload-time = "2026-11-15T17:03:29.228Z" }, +] + [[package]] name = "requests" version = "2.33.0" From ccec642ca6c05982e973fe21fb0c352c7f608d37 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Fri, 25 Sep 2026 15:51:07 +0200 Subject: [PATCH 2/7] doc(spec): define version 1 value requirements --- docs/standard/index.rst | 8 ++++---- docs/standard/types.rst | 15 ++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/standard/index.rst b/docs/standard/index.rst index a3fbf0d8..7e06aed0 100644 --- a/docs/standard/index.rst +++ b/docs/standard/index.rst @@ -55,7 +55,7 @@ Specification .. rst-class:: key-meta -:ref:`string ` +:ref:`enumerated string ` The version of the specification the file follows: ``"1"``. @@ -130,9 +130,9 @@ Allowed values: ``platforms`` *(required)* ~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. rst-class:: key-meta key-meta-union +.. rst-class:: key-meta -:meta-type:`enumerated string ` or :meta-type:`array ` of :meta-type:`strings ` +:ref:`array ` of :ref:`strings ` Values: ``web``, ``windows``, ``mac``, ``linux``, ``ios``, ``android``. When none of them fits, another human readable value @@ -771,7 +771,7 @@ A link to a public roadmap of the software. .. rst-class:: key-meta -:ref:`array ` of :ref:`strings ` +:ref:`array ` of :ref:`URLs ` .. code-block:: yaml :caption: Example diff --git a/docs/standard/types.rst b/docs/standard/types.rst index 11405e79..e520d58e 100644 --- a/docs/standard/types.rst +++ b/docs/standard/types.rst @@ -41,6 +41,9 @@ Array A YAML sequence of values of the same type. +A key of this type MUST hold a list even for a single item. For +example, write ``platforms: [web]``. + An array MUST contain at least one item and MUST NOT contain duplicates. Omit an optional key if you have no items to list. @@ -216,12 +219,14 @@ Organisation ------------ An entity that can fund software development, such as an -association, a company or a public authority. +association, a company or a public authority. Its properties follow +the same rules as the :ref:`organisation ` section. Properties: -- ``name`` *(required)*, :ref:`string `: The name of the +- ``uri`` *(required)*, :ref:`URI `: The URI identifying + the organisation. +- ``name``, :ref:`string `: The name of the organisation, whether it’s an association, a company, a public - sector organisation or a physical person. -- ``uri``, :ref:`URI `: The URI identifying the - organisation. + sector organisation or a physical person. It is a human readable + label for ``uri``. From c71f2931193db68bec0d1798274bd7fb98390f67 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Fri, 25 Sep 2026 15:53:46 +0200 Subject: [PATCH 3/7] doc(spec): place the fork guide after the reference pages --- docs/standard/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/index.rst b/docs/standard/index.rst index 7e06aed0..293c9b87 100644 --- a/docs/standard/index.rst +++ b/docs/standard/index.rst @@ -23,9 +23,9 @@ The :doc:`full example ` uses every key. :maxdepth: 2 :hidden: - forks.rst types.rst vocabularies.rst + forks.rst example.rst Conventions From 20bcacb13731a1b919d0e6c47e2378b1c5276fbe Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Fri, 25 Sep 2026 16:53:49 +0200 Subject: [PATCH 4/7] doc: simplify punctuation and wording --- README.md | 2 +- docs/standard/forks.rst | 4 ++-- docs/standard/index.rst | 46 +++++++++++++++++++---------------------- docs/standard/types.rst | 8 +++---- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 2a35d6d1..4ff38ca0 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ description: shortDescription: A lightweight text editor longDescription: > A lightweight yet powerful text editor designed for everyday use by developers, - writers, and public administrations. It also supports syntax highlighting. + writers and public administrations. It also supports syntax highlighting. features: - Syntax highlighting - Collaborative editing features diff --git a/docs/standard/forks.rst b/docs/standard/forks.rst index 0afba26e..3eea0d1e 100644 --- a/docs/standard/forks.rst +++ b/docs/standard/forks.rst @@ -23,8 +23,8 @@ you MUST update ``publiccode.yml`` to describe it: - Point :ref:`url ` to the repository of the fork. - Add :ref:`isBasedOn ` with the ``url`` of the software it was forked from. -- Replace :ref:`organisation `, both ``uri`` and - ``name``, with the organisation publishing the fork, or remove the +- Replace :ref:`organisation ` with the fork's + publisher, updating both ``uri`` and ``name``. You can omit this section. - Use :ref:`maintenance ` to describe who maintains the fork and how. diff --git a/docs/standard/index.rst b/docs/standard/index.rst index 293c9b87..8ca54680 100644 --- a/docs/standard/index.rst +++ b/docs/standard/index.rst @@ -34,8 +34,8 @@ Conventions The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, MAY and OPTIONAL in this document are to be interpreted as described in BCP 14 (`RFC 2119 `__, -`RFC 8174 `__) when, and only -when, they appear in all capitals. +`RFC 8174 `__) only when they +appear in all capitals. A key marked *(required)* MUST be present. Within an optional section, required keys MUST be present if you include that section. @@ -120,8 +120,8 @@ Allowed values: - ``standalone/backend``: A backend application exposing interfaces (e.g. APIs) to other services, with no direct user interface. - ``standalone/other``: A standalone application of another kind. -- ``addon``: A plugin, theme or other addon for a host - software (e.g. a CMS or an office suite). +- ``addon``: A plugin, theme or other extension for an application, + such as a CMS or an office suite. - ``library``: A library or an SDK for developers to use in other software. - ``configurationFiles``: Configuration files or scripts for a @@ -173,14 +173,13 @@ Allowed values: Descriptions of the software, grouped by language. -The strings in this section are user-visible and grouped by -language: each language is a sub-section named with its -:ref:`language tag `, and at least -one language MUST be present. +Use a subsection for each language, named with its +:ref:`language tag `. At least one language MUST +be present. An example for English: -.. code:: yaml +.. code:: yaml description: en: @@ -433,10 +432,10 @@ When the URI follows a recognized format, parsers MAY read more information from its structure, for example an institutional domain or an official code. -It is RECOMMENDED that crawlers and consumers of ``publiccode.yml`` -verify out of band that the declared URI belongs to the organisation -in control of the repository. How to verify it is up to the -implementation and policies of each consumer. +Consumers of ``publiccode.yml`` SHOULD use a trusted source outside +the file to verify that the URI belongs to the organisation in +control of the repository. Each consumer chooses its verification +method. .. _organisation-name: @@ -497,7 +496,7 @@ Allowed values: .. rst-class:: key-condition MUST be present if :ref:`maintenance/type ` is -``contract``, and MUST NOT be present otherwise. +``contract``. MUST NOT be present otherwise. The entities currently contracted to maintain the software: companies, organisations or other collective names. @@ -512,7 +511,7 @@ companies, organisations or other collective names. .. rst-class:: key-condition MUST be present if :ref:`maintenance/type ` is -``internal`` or ``community``, and is optional otherwise. +``internal`` or ``community``. Optional otherwise. The people responsible for technical maintenance. Each contact MUST be a person. Use ``affiliation`` for the institution they represent. @@ -617,10 +616,9 @@ The date the latest version was released. landingURL: https://example.com/firefax -A browsable page for humans, used in place of :ref:`url ` when ``url`` -serves raw source code to a version control client only. Catalogs -link people here instead of ``url``. If the product provides a -graphical installer, this page can also offer it for download. +A web page that catalogs link to when :ref:`url ` gives access +only to a version control client. The page can also offer a graphical +installer for download. ``applicationSuite`` ~~~~~~~~~~~~~~~~~~~~ @@ -675,14 +673,12 @@ software supports or complies with. :ref:`URI ` An identifier for the supported standard, regulation, framework or -system. It is either an alias in the form ``alias:``, resolved -through the :ref:`list of aliases `, or any other URI -referencing the resource directly. +system. Use ``alias:`` with a name from the +:ref:`list of aliases ` or another URI for the resource. An ``alias:`` value MUST exist in the :ref:`list of aliases -`. An unknown alias is an error. Any other value MUST be a -syntactically valid URI. A value that is well formed but not otherwise -known is accepted as is. +`. An unknown alias is an error. Other values MUST be valid +URIs. Parsers accept these even if they do not recognize the resource. .. tip:: diff --git a/docs/standard/types.rst b/docs/standard/types.rst index e520d58e..276ebc10 100644 --- a/docs/standard/types.rst +++ b/docs/standard/types.rst @@ -157,7 +157,7 @@ Contractor Properties: - ``name`` (**required**), :ref:`string `: The name of the - contractor, whether it’s a company or a physical person. + company or person providing maintenance. - ``until`` (**required**), :ref:`date `: The date the maintenance is going to end. For community maintenance, it SHOULD be no more than two years in the future. Update it regularly while @@ -226,7 +226,5 @@ Properties: - ``uri`` *(required)*, :ref:`URI `: The URI identifying the organisation. -- ``name``, :ref:`string `: The name of the - organisation, whether it’s an association, a company, a public - sector organisation or a physical person. It is a human readable - label for ``uri``. +- ``name``, :ref:`string `: The name of the organisation + or person identified by ``uri``. From a1af51862207b2b33f7e47e5c04b2bba8e400793 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Tue, 17 Nov 2026 17:03:07 +0000 Subject: [PATCH 5/7] fix: retain recursive example checks after rebase --- scripts/check-examples.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/scripts/check-examples.py b/scripts/check-examples.py index 375f2313..1aad99a1 100755 --- a/scripts/check-examples.py +++ b/scripts/check-examples.py @@ -42,12 +42,19 @@ def documented_keys(): headings.append((index, match[1])) keys = set() + arrays = set() for position, (start, key) in enumerate(headings): + key = "/".join( + part + ("/[]" if "/".join(key.split("/")[:i + 1]) in arrays else "") + for i, part in enumerate(key.split("/")) + ) keys.add(key) end = headings[position + 1][0] if position + 1 < len(headings) else len(lines) section = "\n".join(lines[start:end]) + if re.search(r"(?:array|:ref:`array `) of", section): + arrays.add(key) item_properties = properties(section) - match = re.search(r"array of :ref:`[^`]+ <([^>]+)>`", section) + match = re.search(r"(?:array|:ref:`array `) of :ref:`[^`]+ <([^>]+)>`", section) if match: item_properties |= types[match[1]] keys.update(f"{key}/[]/{prop}" for prop in item_properties) @@ -71,20 +78,6 @@ def used_keys(node, prefix=""): return keys -def list_item_keys(node, containers, prefix=""): - """Key paths inside the mappings of lists, like supports/id.""" - keys = set() - for key, value in node.items(): - path = f"{prefix}{key}" - if isinstance(value, dict): - keys |= list_item_keys(value, containers, path + "/") - elif isinstance(value, list) and path in containers: - for item in value: - if isinstance(item, dict): - keys |= {f"{path}/{k}" for k in item} - return keys - - def check_descriptions(name, data): errors = [] for lang, texts in data.get("description", {}).items(): @@ -101,12 +94,10 @@ def check_descriptions(name, data): def main(): spec = documented_keys() - containers = {key.rsplit("/", 1)[0] for key in spec if "/" in key} errors = [] for path in (MINIMAL, FULL): data = yaml.safe_load(path.read_text()) - # Typed objects have their properties on the Types page. - used = used_keys(data) | list_item_keys(data, containers) + used = used_keys(data) for key in sorted(used - spec): errors.append(f"{path}: {key} is not documented in {SPEC}") if path == FULL: From 3c4e8fbe6f6cbc4c8311156c35e4dc64ee20ad87 Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Tue, 17 Nov 2026 17:33:54 +0000 Subject: [PATCH 6/7] doc: preserve funder requirements and list validation changes --- CHANGELOG.rst | 14 ++++++++++++++ docs/standard/types.rst | 11 +++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 31e3b228..512c98a6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,20 @@ Removed Changed ~~~~~~~ +* Reject unknown keys and null values. Omit optional keys without a + value. +* Require arrays to be YAML sequences, including for a single item, + with at least one item and no duplicates. +* Require string values to be YAML strings, rejecting numbers and + booleans. Ignore surrounding whitespace, reject empty strings and + allow line breaks only where explicitly permitted. Count characters + using Unicode extended grapheme clusters after trimming whitespace. +* Require calendar dates to exist and be quoted strings in + ``YYYY-MM-DD`` format. +* Reject repository paths that start with ``/`` or refer outside the + repository. Require absolute HTTP or HTTPS URLs unless the key allows + other schemes. + * Require E.164 format for ``maintenance/contacts/phone`` by @bfabio in https://github.com/publiccodeyml/publiccode.yml/pull/306 * Require uppercase ISO 3166-1 alpha-2 country codes in ``intendedAudience/countries`` and ``intendedAudience/unsupportedCountries`` by @bfabio in https://github.com/publiccodeyml/publiccode.yml/pull/325 * Require YAML 1.2, removing the deprecated YAML 1.1 allowance, by @bfabio in https://github.com/publiccodeyml/publiccode.yml/pull/325 diff --git a/docs/standard/types.rst b/docs/standard/types.rst index 276ebc10..61e96468 100644 --- a/docs/standard/types.rst +++ b/docs/standard/types.rst @@ -219,12 +219,11 @@ Organisation ------------ An entity that can fund software development, such as an -association, a company or a public authority. Its properties follow -the same rules as the :ref:`organisation ` section. +association, a company or a public authority. Properties: -- ``uri`` *(required)*, :ref:`URI `: The URI identifying - the organisation. -- ``name``, :ref:`string `: The name of the organisation - or person identified by ``uri``. +- ``name`` *(required)*, :ref:`string `: The name of the + organisation or person funding the software. +- ``uri``, :ref:`URI `: The URI identifying the organisation + or person named in ``name``. From 49fa9487a983e22e0c73d2dacb8754c80271ca2f Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Tue, 17 Nov 2026 17:40:21 +0000 Subject: [PATCH 7/7] doc: clarify mixed arrays and document validation changes --- CHANGELOG.rst | 6 ++++++ docs/standard/types.rst | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 512c98a6..16737371 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -25,6 +25,12 @@ Changed booleans. Ignore surrounding whitespace, reject empty strings and allow line breaks only where explicitly permitted. Count characters using Unicode extended grapheme clusters after trimming whitespace. +* Require enumerated strings to match the listed values exactly, + including case. +* Require e-mail addresses in RFC 5322 ``addr-spec`` form, without + display names. +* Reject dependencies that combine ``version`` with ``versionMin`` or + ``versionMax``. * Require calendar dates to exist and be quoted strings in ``YYYY-MM-DD`` format. * Reject repository paths that start with ``/`` or refer outside the diff --git a/docs/standard/types.rst b/docs/standard/types.rst index 61e96468..0849ec84 100644 --- a/docs/standard/types.rst +++ b/docs/standard/types.rst @@ -39,7 +39,10 @@ Boolean Array ----- -A YAML sequence of values of the same type. +A YAML sequence of values. Each item MUST have a type allowed by the +key. When a key allows several types, an array MAY mix them. For +example, ``description/[lang]/screenshots`` may contain both paths +and URLs. A key of this type MUST hold a list even for a single item. For example, write ``platforms: [web]``.