Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v6.0.0
hooks:
- id: check-yaml
- repo: https://github.com/snakemake/snakefmt
rev: v0.6.1
rev: v0.11.5
hooks:
- id: snakefmt
- repo: https://github.com/psf/black
rev: 22.6.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black
- repo: https://github.com/PyCQA/isort.git
rev: 5.10.1
rev: 8.0.1
hooks:
- id: isort
- repo: https://github.com/python-poetry/poetry
Expand Down
5 changes: 0 additions & 5 deletions mccoy/workflow/rules/report.smk
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,22 @@ rule report:
loader = jinja2.FileSystemLoader(report_dir)
env = jinja2.Environment(loader=loader, autoescape=jinja2.select_autoescape())


def include_file_unsafe(name):
if name:
return Path(str(name)).read_text()
return ""


def include_file(name):
if name:
return markupsafe.Markup(include_file_unsafe(name))
return ""


def include_raw(name):
if name:
file = report_dir / name
return markupsafe.Markup(file.read_text())
return ""


env.globals['include_file_unsafe'] = include_file_unsafe
env.globals['include_file'] = include_file
env.globals['include_raw'] = include_raw
Expand All @@ -90,7 +86,6 @@ rule report:
except Exception as err:
print(f"could not render template: {err}")


with open(output_path, 'w') as f:
print(f"Writing result to {output_path}")
f.write(result)
Loading