Skip to content

Commit

Permalink
Update linting rules
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Oct 18, 2024
1 parent 71d8e83 commit 1f8f803
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dso/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def check(cls, file):
# .parent to remove the dvc.yaml filename
stage_path_expected = str(stage_path_expected.parent.relative_to(root_path))
content = file.read_text()
pattern = r"params\s*(=|<-)\s*(dso::)?read_params\s*\(([\s\S]*?)(\s*,.*)?\)"
pattern = r"[\s\S]*(dso::)?read_params\s*\(([\s\S]*?)(\s*,.*)?\)"
res = re.findall(pattern, content, flags=re.MULTILINE)
if len(res) == 0:
raise LintError(f"no `params = read_params('{stage_path_expected}')` statement found in qmd document")
Expand Down
6 changes: 5 additions & 1 deletion tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ class MockQuartoRule(QuartoRule):
),
(
"""foo = read_params("quarto_stage")""",
LintError,
None,
),
(
"""read_params("quarto_stage")""",
None,
),
(
"""\
Expand Down

0 comments on commit 1f8f803

Please sign in to comment.