From 55f1af8bb868e90b0fcbd48bd1a65f16f538a5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 18 Feb 2022 15:20:47 +0100 Subject: [PATCH] add nothing_formatter.py --- PyTeX/format/nothing_formatter.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 PyTeX/format/nothing_formatter.py diff --git a/PyTeX/format/nothing_formatter.py b/PyTeX/format/nothing_formatter.py new file mode 100644 index 0000000..c6f1703 --- /dev/null +++ b/PyTeX/format/nothing_formatter.py @@ -0,0 +1,25 @@ +from .formatting_config import FormattingConfig +from .pytex_formatter import PyTeXFormatter +from pathlib import Path +import shutil + +from typing import List, Tuple + + +class NothingFormatter(PyTeXFormatter): + """ + Class that will represent a source file that + should not be formatted. + + This is modeled by not having any output files, + so the builder will never consider building this file + """ + + def output_files(self) -> List[str]: + return [] + + def format(self, build_dir: Path, overwrite: bool = False) -> List[Tuple[str, FormattingConfig]]: + raise NotImplementedError + + def dependencies(self) -> List[str]: + return []