summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gen-cpydiff.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/gen-cpydiff.py b/tools/gen-cpydiff.py
index 1d458d3dc..d4c8a5736 100644
--- a/tools/gen-cpydiff.py
+++ b/tools/gen-cpydiff.py
@@ -85,6 +85,16 @@ def readfiles():
class_, desc, cause, workaround, code = [
x.rstrip() for x in list(filter(None, re.split(SPLIT, text)))
]
+
+ # remove black `fmt: on/off/skip` comments
+ code = "".join(
+ # skip comments are inline, so we replace just the comment
+ re.sub(r"\s*# fmt: skip", "", x)
+ for x in code.splitlines(keepends=True)
+ # on/off comments are on their own line, so we omit the entire line
+ if not re.match(r"\s*# fmt: (on|off)\s*", x)
+ )
+
output = Output(test, class_, desc, cause, workaround, code, "", "", "")
files.append(output)
except IndexError: