From 375f6a808b7e9884906f949704c0a92a3b36fca3 Mon Sep 17 00:00:00 2001 From: Cem Dervis Date: Sun, 11 Jan 2026 02:05:54 +0100 Subject: [PATCH 1/6] Add features YAML schema --- features.schema.yaml | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 features.schema.yaml diff --git a/features.schema.yaml b/features.schema.yaml new file mode 100644 index 0000000..633e533 --- /dev/null +++ b/features.schema.yaml @@ -0,0 +1,82 @@ +$schema: "http://json-schema.org/draft-07/schema#" +title: Feature List Schema +type: object +required: + - features +properties: + features: + type: array + items: + $ref: "#/definitions/feature" +definitions: + feature: + type: object + required: + - desc + additionalProperties: false + properties: + desc: + type: string + description: "The title and / or description of the feature. Supports Markdown." + paper: + description: "One or multiple paper numbers that belong to the feature." + oneOf: + - type: string + - type: array + items: + type: string + lib: + type: boolean + default: false + description: "If true, the feature counts as a standard library feature." + support: + type: array + description: "A list of toolchains that support the feature." + items: + type: string + pattern: "^(GCC|Clang|MSVC|Xcode)( [0-9]+(\\.[0-9]+)*)?( \\((partial|hint)\\))?$" + hints: + type: array + description: "A list of hints targeting toolchains in the support list." + items: + type: object + required: + - target + - msg + additionalProperties: false + properties: + target: + type: string + description: "The toolchain that this hint targets." + msg: + type: string + description: "The reason for partial support, or the hint. Supports Markdown." + ftm: + type: array + description: "A list of feature-testing macros (FTM) for the feature." + items: + type: object + required: + - name + - value + additionalProperties: false + properties: + name: + type: string + description: "The name of the FTM." + value: + oneOf: + - type: string + - type: integer + description: "The value of the FTM." + desc: + type: string + description: "Optional description of what this FTM specifically refers to." + content: + type: string + description: "Information about the feature (e.g. a filename)." + keywords: + type: array + description: "A list of keywords to categorize the feature." + items: + type: string From 18d7977b58cda62d0392f9176fe4a55d67cad47e Mon Sep 17 00:00:00 2001 From: Cem Dervis Date: Sun, 11 Jan 2026 02:06:04 +0100 Subject: [PATCH 2/6] Add Python script to verify feature files --- verify_features.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 verify_features.py diff --git a/verify_features.py b/verify_features.py new file mode 100644 index 0000000..c58825f --- /dev/null +++ b/verify_features.py @@ -0,0 +1,35 @@ +import yaml +import jsonschema +import sys + +def validate_yaml(schema_file, data_file): + try: + with open(schema_file, 'r') as f: + schema = yaml.safe_load(f) + + with open(data_file, 'r') as f: + data = yaml.safe_load(f) + + jsonschema.validate(instance=data, schema=schema) + print(f"Verification successful: {data_file}") + return True + except jsonschema.exceptions.ValidationError as e: + print(f"Verification failed: {data_file}") + print(f"Error: {e.message}") + print(f"Path: {' -> '.join(map(str, e.path))}") + return False + except Exception as e: + print(f"An error occurred: {e}") + return False + +if __name__ == "__main__": + schema_path = "features.schema.yaml" + + if len(sys.argv) < 2: + print("Usage: python3 verify_features.py ") + sys.exit(1) + + data_path = sys.argv[1] + success = validate_yaml(schema_path, data_path) + if not success: + sys.exit(1) From fea3f6f8f3a4ec5ef9acb565036d0f0d298fd493 Mon Sep 17 00:00:00 2001 From: Cem Dervis Date: Sun, 11 Jan 2026 02:09:24 +0100 Subject: [PATCH 3/6] Add missing document starts --- features.schema.yaml | 1 + features_c23.yaml | 1 + features_c99.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/features.schema.yaml b/features.schema.yaml index 633e533..d685585 100644 --- a/features.schema.yaml +++ b/features.schema.yaml @@ -1,3 +1,4 @@ +--- $schema: "http://json-schema.org/draft-07/schema#" title: Feature List Schema type: object diff --git a/features_c23.yaml b/features_c23.yaml index 6a003c1..c0ee85d 100644 --- a/features_c23.yaml +++ b/features_c23.yaml @@ -1,3 +1,4 @@ +--- features: - desc: "`static_assert` with no message" paper: N3020 diff --git a/features_c99.yaml b/features_c99.yaml index c852de2..f21a6c1 100644 --- a/features_c99.yaml +++ b/features_c99.yaml @@ -1,3 +1,4 @@ +--- features: - desc: "Universal-character-names in [identifiers](https://en.cppreference.com/w/c/language/identifiers.html)" support: From 425a07d4eb0c115ecf880ba038b3b94d88d2b73f Mon Sep 17 00:00:00 2001 From: Cem Dervis Date: Sun, 11 Jan 2026 02:27:08 +0100 Subject: [PATCH 4/6] Update workflow file --- .github/workflows/verify-data.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/verify-data.yml b/.github/workflows/verify-data.yml index 7ec4f81..6354ba0 100644 --- a/.github/workflows/verify-data.yml +++ b/.github/workflows/verify-data.yml @@ -20,3 +20,19 @@ jobs: yamllint_file_or_dir: "*.yaml" yamllint_strict: false yamllint_comment: false + + - name: "Set up Python" + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: "Install dependencies" + run: | + python3 -m pip install --upgrade pip + python3 -m pip install PyYAML jsonschema + + - name: "Verify features" + run: | + for file in features_c*.yaml; do + python3 verify_features.py "$file" + done From cabf8955ffea80f3a2b57a00c76c780fd554bc2a Mon Sep 17 00:00:00 2001 From: Cem Dervis Date: Sun, 11 Jan 2026 02:29:54 +0100 Subject: [PATCH 5/6] Test invalid data --- features_cpp23.yaml | 3 +++ features_cpp26.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/features_cpp23.yaml b/features_cpp23.yaml index 62a31c6..35b7d08 100644 --- a/features_cpp23.yaml +++ b/features_cpp23.yaml @@ -73,6 +73,7 @@ features: - Clang - MSVC 19.30 - Xcode + unknown: true - desc: "Remove mixed wide string literal concatenation" paper: P2201 @@ -210,6 +211,8 @@ features: hints: - target: MSVC 19.50 msg: "Only supports octal and hexadecimal escape sequences, no universal character name escape sequences." + - target: GCC 16 + msg: "Invalid" - desc: "Named universal character escapes" paper: P2071 diff --git a/features_cpp26.yaml b/features_cpp26.yaml index 0e505e1..b16a59b 100644 --- a/features_cpp26.yaml +++ b/features_cpp26.yaml @@ -406,6 +406,7 @@ features: support: - GCC 15 - Clang 20 + - Invalid ftm: - name: __cpp_variadic_friend value: 202403L From a7ecbf423607a2f583b9793d1ffda27cf2f671be Mon Sep 17 00:00:00 2001 From: Cem Dervis Date: Sun, 11 Jan 2026 02:31:04 +0100 Subject: [PATCH 6/6] Revert invalid data test --- features_cpp23.yaml | 3 --- features_cpp26.yaml | 1 - 2 files changed, 4 deletions(-) diff --git a/features_cpp23.yaml b/features_cpp23.yaml index 35b7d08..62a31c6 100644 --- a/features_cpp23.yaml +++ b/features_cpp23.yaml @@ -73,7 +73,6 @@ features: - Clang - MSVC 19.30 - Xcode - unknown: true - desc: "Remove mixed wide string literal concatenation" paper: P2201 @@ -211,8 +210,6 @@ features: hints: - target: MSVC 19.50 msg: "Only supports octal and hexadecimal escape sequences, no universal character name escape sequences." - - target: GCC 16 - msg: "Invalid" - desc: "Named universal character escapes" paper: P2071 diff --git a/features_cpp26.yaml b/features_cpp26.yaml index b16a59b..0e505e1 100644 --- a/features_cpp26.yaml +++ b/features_cpp26.yaml @@ -406,7 +406,6 @@ features: support: - GCC 15 - Clang 20 - - Invalid ftm: - name: __cpp_variadic_friend value: 202403L