Skip to content

Commit

Permalink
Add check that field level is set on all fields (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin authored and webmat committed Oct 19, 2018
1 parent d0cc4f5 commit 7fe9c89
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ def filtered_fields(fields, groups):

return new_fields

def check_fields(fields):
for f in fields:
for field in list(f["fields"]):
if field["level"] not in ["core", "extended"]:
raise Exception('Field {} does not have an allowed level'.format(field["name"]))

if __name__ == "__main__":

Expand All @@ -86,6 +91,8 @@ def filtered_fields(fields, groups):
parser.add_argument('--stdout', help='output to stdout instead of files')
args = parser.parse_args()

check_fields(sortedNamespaces)

if args.stdout == "true":
groups = [1, 2, 3]
f_fields = filtered_fields(sortedNamespaces, groups)
Expand Down

0 comments on commit 7fe9c89

Please sign in to comment.