Skip to content

Commit

Permalink
fix(entrypoint): fixes top level ModelFilter logic (#71)
Browse files Browse the repository at this point in the history
* fix(entrypoint): fixes top level ModelFilter logic

Replace "." with "*" for include all logic
Adds tests to ModelFilter to validate

Signed-off-by: Jennifer Power <[email protected]>

* fix: fixes formatting

Signed-off-by: Jennifer Power <[email protected]>

---------

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 authored Oct 26, 2023
1 parent 8cae7bc commit b28e496
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/trestlebot/tasks/test_assemble_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_assemble_task_with_skip(tmp_trestle_dir: str, skip_list: List[str]) ->

mock = Mock(spec=AuthorObjectBase)

filter = ModelFilter(skip_list, ["."])
filter = ModelFilter(skip_list, ["*"])

assemble_task = AssembleTask(
working_dir=tmp_trestle_dir,
Expand Down
4 changes: 3 additions & 1 deletion tests/trestlebot/tasks/test_base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
[
[["simplified_nist_catalog"], [], "simplified_nist_catalog", True],
[[], ["simplified_nist_catalog"], "simplified_nist_catalog", False],
[["simplified*"], ["."], "simplified_nist_catalog", True],
[["simplified*"], ["*"], "simplified_nist_catalog", True],
[
["simplified_nist_catalog"],
["simplified*"],
"simplified_nist_profile",
False,
],
[[], [], "simplified_nist_catalog", True],
[[], ["*"], "simplified_nist_catalog", False],
],
)
def test_is_skipped(
Expand Down
2 changes: 1 addition & 1 deletion tests/trestlebot/tasks/test_regenerate_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_regenerate_task_with_skip(tmp_trestle_dir: str, skip_list: List[str]) -

mock = Mock(spec=AuthorObjectBase)

filter = ModelFilter(skip_list, ["."])
filter = ModelFilter(skip_list, ["*"])

regenerate_task = RegenerateTask(
working_dir=tmp_trestle_dir,
Expand Down
2 changes: 1 addition & 1 deletion trestlebot/entrypoints/autosync.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def run(self, args: argparse.Namespace) -> None:

filter: ModelFilter = ModelFilter(
skip_patterns=comma_sep_to_list(args.skip_items),
include_patterns=["."],
include_patterns=["*"],
)

# Assuming an edit has occurred assemble would be run before regenerate.
Expand Down
2 changes: 1 addition & 1 deletion trestlebot/entrypoints/rule_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def run(self, args: argparse.Namespace) -> None:

filter: ModelFilter = ModelFilter(
skip_patterns=comma_sep_to_list(args.skip_items),
include_patterns=["."],
include_patterns=["*"],
)

rule_transform_task: RuleTransformTask = RuleTransformTask(
Expand Down

0 comments on commit b28e496

Please sign in to comment.