Skip to content

Commit

Permalink
Merge pull request #288 from m4rc1e/server-lint-file
Browse files Browse the repository at this point in the history
push-status: Lint axis registry files
  • Loading branch information
m4rc1e authored Jan 6, 2021
2 parents 6e49f4e + d47971c commit 5c76b41
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/gftools-push-status.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,17 @@ def push_report(fp):


def missing_paths(fp):
dirs = [fp.parent / p for p in parse_server_file(fp)]
return [p for p in dirs if not p.is_dir()]
paths = [fp.parent / p for p in parse_server_file(fp)]
axis_files = [p for p in paths if p.name.endswith("textproto")]
dirs = [p for p in paths if p not in axis_files]

missing_dirs = [p for p in dirs if not p.is_dir()]
missing_axis_files = [p for p in axis_files if not p.is_file()]
return missing_dirs + missing_axis_files


def lint_server_files(fp):
template = "{}: Following paths are not valid dirs:\n{}\n\n"
template = "{}: Following paths are not valid:\n{}\n\n"
prod_path = fp / "to_production.txt"
prod_missing = "\n".join(map(str, missing_paths(prod_path)))
prod_msg = template.format("to_production.txt", prod_missing)
Expand Down

0 comments on commit 5c76b41

Please sign in to comment.