Skip to content

Commit

Permalink
Include "tests" folders in the build tool groups
Browse files Browse the repository at this point in the history
Allow absent "prefix" in group entries to simplify the code
  • Loading branch information
kvid committed Sep 9, 2023
1 parent b46011b commit 7671916
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wireviz/tools/build_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"path": dir / "examples",
"prefix": "demo",
},
**{p.stem: {"path": p} for p in (dir / "tests").glob("**")},
}

input_extensions = [".yml"]
Expand All @@ -43,7 +44,7 @@

def collect_filenames(description, groupkey, ext_list):
path = groups[groupkey]["path"]
patterns = [f"{groups[groupkey]['prefix']}*{ext}" for ext in ext_list]
patterns = [f"{groups[groupkey].get('prefix', '')}*{ext}" for ext in ext_list]
if ext_list != input_extensions and readme in groups[groupkey]:
patterns.append(readme)
print(f'{description} {groupkey} in "{path}"')
Expand Down

0 comments on commit 7671916

Please sign in to comment.