Skip to content

Commit

Permalink
manage.py: Update pre-commit to reflect changes in json_dump/json_load
Browse files Browse the repository at this point in the history
  • Loading branch information
duncandewhurst committed Oct 23, 2024
1 parent 6948447 commit a53d550
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def pre_commit():
- versioned-release-validation-schema.json
- strict-release-schema.json
- strict-release-package.json
- strict-record-package.jso
- strict-record-package.json
- strict-dereferenced-release-schema.json
- strict-versioned-release-validation-schema.json
"""
Expand All @@ -584,6 +584,7 @@ def pre_commit():
}

release_schema = json_load('release-schema.json')
strict_release_schema = get_strict_schema(deepcopy(release_schema))
jsonref_release_schema = json_load('release-schema.json', jsonref, merge_props=True)

counts = defaultdict(list)
Expand Down Expand Up @@ -640,15 +641,15 @@ def pre_commit():

# Strict schemas.
directory = Path('strict')
strict_release_schema = get_strict_schema(deepcopy(release_schema))
json_dump(directory / 'release-schema', strict_release_schema)
json_dump(directory / 'release-schema.json', strict_release_schema)

strict_dereferenced_release_schema = json_load(directory / 'release-schema', jsonref, merge_props=True)
json_dump(directory / 'dereferenced-release-schema', strict_dereferenced_release_schema)
json_dump(directory / 'versioned-release-validation-schema', get_versioned_release_schema(strict_release_schema))
strict_dereferenced_release_schema = json_load(directory / 'release-schema.json', jsonref, merge_props=True)
json_dump(directory / 'dereferenced-release-schema.json', strict_dereferenced_release_schema)
json_dump(directory / 'versioned-release-validation-schema.json',
get_versioned_release_schema(strict_release_schema))

json_dump(directory / 'release-package-schema', get_strict_schema(json_load('release-package-schema')))
json_dump(directory / 'record-package-schema', get_strict_schema(json_load('record-package-schema')))
json_dump(directory / 'release-package-schema.json', get_strict_schema(json_load('release-package-schema.json')))
json_dump(directory / 'record-package-schema.json', get_strict_schema(json_load('record-package-schema.json')))


@cli.command()
Expand Down

0 comments on commit a53d550

Please sign in to comment.