diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95b4eba..be855b7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/mccoy/workflow/rules/report.smk b/mccoy/workflow/rules/report.smk index 1ce6e07..7ff6490 100644 --- a/mccoy/workflow/rules/report.smk +++ b/mccoy/workflow/rules/report.smk @@ -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 @@ -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)