From 13484f4af6efd8462b513a668f53a2f672a45c2e Mon Sep 17 00:00:00 2001 From: thm Date: Sun, 28 Jan 2024 12:27:18 +0000 Subject: [PATCH 1/2] add reason to support wider boycott list change validation script to validate all in PR before exiting --- schemas/brand_schema.yaml | 1 + scripts/validate_yaml.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/schemas/brand_schema.yaml b/schemas/brand_schema.yaml index 54bf33c..ab37685 100644 --- a/schemas/brand_schema.yaml +++ b/schemas/brand_schema.yaml @@ -22,6 +22,7 @@ properties: enum: - operations_in_israel - operations_in_settlements + - other countries: description: |- A list of countries (ISO alpha-2 country codes) that the brand operates in. diff --git a/scripts/validate_yaml.py b/scripts/validate_yaml.py index afc72aa..8080058 100644 --- a/scripts/validate_yaml.py +++ b/scripts/validate_yaml.py @@ -42,9 +42,14 @@ def main(): company_schema = load_yaml(os.path.join(root_path, "schemas/company_schema.yaml")) company_files = glob.glob(os.path.join(root_path, "data/companies/") + "*.yaml") print("Validating", len(company_files), "companies") + failed = False for file in company_files: if not validate_with_schema(file, company_schema): - exit(1) + failed = True + + if failed: + exit(1) + print("All companies are valid.") From 9b0143cbe48e8e98e642c0a3be5d32cfbaa91966 Mon Sep 17 00:00:00 2001 From: thm Date: Mon, 29 Jan 2024 18:29:43 +0000 Subject: [PATCH 2/2] address PR comments, more specific reasons --- schemas/brand_schema.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schemas/brand_schema.yaml b/schemas/brand_schema.yaml index ab37685..8232283 100644 --- a/schemas/brand_schema.yaml +++ b/schemas/brand_schema.yaml @@ -22,7 +22,8 @@ properties: enum: - operations_in_israel - operations_in_settlements - - other + - executive_supports_israel + - hiring_discrimination countries: description: |- A list of countries (ISO alpha-2 country codes) that the brand operates in.