From e78efff33b24c4c2da242a9118aad01739f51f07 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Jun 2023 20:41:44 +0300 Subject: [PATCH] Allow the use of the underscore symbol in the "keywords" field --- HISTORY.rst | 1 + docs | 2 +- platformio/package/manifest/schema.py | 2 +- tests/package/test_manifest.py | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 7aa40fde..8c180293 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -20,6 +20,7 @@ PlatformIO Core 6 * Added a new ``--lint`` option to the `pio project config `__ command, enabling users to efficiently perform linting on the |PIOCONF| * Enhanced the parsing of the |PIOCONF| to provide comprehensive diagnostic information +* Expanded the functionality of the |LIBRARYJSON| manifest by allowing the use of the underscore symbol in the `keywords `__ field * Optimized project integration templates to address the issue of long paths on Windows (`issue #4652 `_) * Refactored |UNITTESTING| engine to resolve compiler warnings with "-Wpedantic" option (`pull #4671 `_) * Eliminated erroneous warning regarding the use of obsolete PlatformIO Core when downgrading to the stable version (`issue #4664 `_) diff --git a/docs b/docs index 45e6fad5..eaf1ae10 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 45e6fad5dcd601e88aec0411c0ed76e9849ef7a6 +Subproject commit eaf1ae10f9b2d3d37a5c55056dd7d17ba344d060 diff --git a/platformio/package/manifest/schema.py b/platformio/package/manifest/schema.py index f1ec9445..95e08108 100644 --- a/platformio/package/manifest/schema.py +++ b/platformio/package/manifest/schema.py @@ -183,7 +183,7 @@ class ManifestSchema(BaseSchema): validate=[ validate.Length(min=1, max=50), validate.Regexp( - r"^[a-z\d\-\+\. ]+$", error="Only [a-z0-9-+. ] chars are allowed" + r"^[a-z\d\-_\+\. ]+$", error="Only [a-z0-9+_-. ] chars are allowed" ), ] ) diff --git a/tests/package/test_manifest.py b/tests/package/test_manifest.py index a3279e05..bcc7e00a 100644 --- a/tests/package/test_manifest.py +++ b/tests/package/test_manifest.py @@ -28,7 +28,7 @@ def test_library_json_parser(): contents = """ { "name": "TestPackage", - "keywords": "kw1, KW2, kw3, KW2", + "keywords": "kw1, KW2, kw3, KW2, kw 4, kw_5, kw-6", "headers": "include1.h, Include2.hpp", "platforms": ["atmelavr", "espressif"], "repository": { @@ -62,7 +62,7 @@ def test_library_json_parser(): "url": "https://github.com/username/repo.git", }, "export": {"exclude": [".gitignore", "tests"], "include": ["mylib"]}, - "keywords": ["kw1", "kw2", "kw3"], + "keywords": ["kw1", "kw2", "kw3", "kw 4", "kw_5", "kw-6"], "headers": ["include1.h", "Include2.hpp"], "homepage": "http://old.url.format", "build": {"flags": ["-DHELLO"]},