Skip to content

Commit

Permalink
Merge branch 'main' into import-data-into-new-format
Browse files Browse the repository at this point in the history
  • Loading branch information
THM222 authored Jan 30, 2024
2 parents ccef062 + f478606 commit 9e57454
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions schemas/brand_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ properties:
enum:
- operations_in_israel
- operations_in_settlements
- executive_supports_israel
- hiring_discrimination
countries:
description: |-
A list of countries (ISO alpha-2 country codes) that the brand operates in.
Expand Down
7 changes: 6 additions & 1 deletion scripts/validate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")


Expand Down

0 comments on commit 9e57454

Please sign in to comment.