From 50a63777ec4b3de137aaa6968b738b084dccf007 Mon Sep 17 00:00:00 2001 From: hexcoder Date: Mon, 11 May 2020 10:12:32 +0200 Subject: python formatter: enhance detection of `#define`, needed for multi line macros @andreafioraldi : please have a look at it. Goal is to detect forms of ' # define' also. --- .custom-format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.custom-format.py') diff --git a/.custom-format.py b/.custom-format.py index 164815b1..6f1b0bfa 100755 --- a/.custom-format.py +++ b/.custom-format.py @@ -70,8 +70,8 @@ def custom_format(filename): out = "" for line in src.split("\n"): - if line.startswith("#"): - if line.startswith("#define"): + if line.lstrip().startswith("#"): + if line[line.find("#")+1:].lstrip().startswith("define"): in_define = True if "/*" in line and not line.strip().startswith("/*") and line.endswith("*/") and len(line) < (COLUMN_LIMIT-2): -- cgit 1.4.1