[tracker/wip/carlosg/check-style-fixes: 2/4] check-style: Fix off-by-one error




commit cdb7d836f3d21e8da2769a6bc3b531968ced3192
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 13 14:25:49 2021 +0200

    check-style: Fix off-by-one error
    
    Checking the end line, we should account that the whole chunk was
    already displaced by the code comment that turns uncrustify on, so
    we are off by one here.

 check-style.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/check-style.py b/check-style.py
index a4cf85612..4b59f83ae 100755
--- a/check-style.py
+++ b/check-style.py
@@ -46,7 +46,7 @@ def reformat_chunks(chunks, rewrite):
 
                 tmp.write(bytes(line, 'utf-8'))
 
-                if i == end - 1:
+                if i == end - 2:
                     tmp.write(b'/** *INDENT-OFF* **/\n')
 
             tmp.seek(0)


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