From 6c9c8fdc651e3c3376f3ba6590c49424be1844d7 Mon Sep 17 00:00:00 2001 From: rhtenhove Date: Mon, 4 Jul 2022 14:32:48 -0400 Subject: check code formatting (#5) --- .custom-format.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to '.custom-format.py') 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: -- cgit 1.4.1