From 08623a0c770bfc2d559e3d9d8fbb6899921f21bf Mon Sep 17 00:00:00 2001 From: Campbell Barton <ideasman42@gmail.com> Date: Tue, 12 Aug 2014 10:25:29 +1000 Subject: [PATCH] catch some operator spacing issues --- check_source/check_style_c.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/check_source/check_style_c.py b/check_source/check_style_c.py index d532286..b0f2163 100755 --- a/check_source/check_style_c.py +++ b/check_source/check_style_c.py @@ -714,10 +714,31 @@ def blender_check_operator(index_start, index_end, op_text, is_cpp): elif op_text == "*>": pass # ignore for now, C++ <Class *> else: - warning("unhandled operator A '%s'" % op_text, index_start, index_end) + warning("unhandled operator 2 '%s'" % op_text, index_start, index_end) + elif len(op_text) == 3: + if op_text in {">>=", "<<="}: + if not _is_ws_pad(index_start, index_end): + if not (is_cpp and ("<" in op_text or ">" in op_text)): + warning("no space around operator '%s'" % op_text, index_start, index_end) + elif op_text == "***": + pass + elif op_text in {"*--", "*++"}: + pass + elif op_text in {"--*", "++*"}: + pass + elif op_text == ">::": + pass + elif op_text == "::~": + pass + else: + warning("unhandled operator 3 '%s'" % op_text, index_start, index_end) + elif len(op_text) == 4: + if op_text == "*>::": + pass + else: + warning("unhandled operator 4 '%s'" % op_text, index_start, index_end) else: - #warning("unhandled operator B '%s'" % op_text, index_start, index_end) - pass + warning("unhandled operator (len > 4) '%s'" % op_text, index_start, index_end) if len(op_text) > 1: if op_text[0] == "*" and op_text[-1] == "*": -- GitLab