aboutsummaryrefslogtreecommitdiff
path: root/.custom-format.py
diff options
context:
space:
mode:
authorrhtenhove <rhtenhove@users.noreply.github.com>2022-07-04 14:32:48 -0400
committerGitHub <noreply@github.com>2022-07-04 14:32:48 -0400
commit6c9c8fdc651e3c3376f3ba6590c49424be1844d7 (patch)
treed656304dd91b8431c00c1cf8228dd83889042c5a /.custom-format.py
parent3e65e1a029c44b33a77ca04724335ee3ecd30e67 (diff)
downloadAFLplusplus-6c9c8fdc651e3c3376f3ba6590c49424be1844d7.tar.gz
check code formatting (#5)
Diffstat (limited to '.custom-format.py')
-rwxr-xr-x.custom-format.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/.custom-format.py b/.custom-format.py
index 7ac63396..8c7ea404 100755
--- a/.custom-format.py
+++ b/.custom-format.py
@@ -19,6 +19,7 @@ import subprocess
import sys
import os
import re
+import shutil
# string_re = re.compile('(\\"(\\\\.|[^"\\\\])*\\")') # future use
@@ -26,6 +27,10 @@ with open(".clang-format") as f:
fmt = f.read()
CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN")
+
+if CLANG_FORMAT_BIN is None:
+ CLANG_FORMAT_BIN = shutil.which("clang-format")
+
if CLANG_FORMAT_BIN is None:
o = 0
try: