[tracker/wip/carlosg/check-style-fixes: 3/4] check-style: Ignore chunks that only contain deleted code




commit f153497c708a5392bd274a7f14172856e78e467e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 13 14:26:59 2021 +0200

    check-style: Ignore chunks that only contain deleted code
    
    These have no code style to check.

 check-style.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/check-style.py b/check-style.py
index 4b59f83ae..eebd13659 100755
--- a/check-style.py
+++ b/check-style.py
@@ -29,7 +29,7 @@ def find_chunks(diff):
             len = int(match.group(2))
             end = start + len
 
-            if file.endswith('.c') or file.endswith('.h') or file.endswith('.vala'):
+            if len > 0 and (file.endswith('.c') or file.endswith('.h') or file.endswith('.vala')):
                 chunks.append({ 'file': file, 'start': start, 'end': end })
 
     return chunks


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]