[tracker/wip/carlosg/check-style-fixes: 1/4] check-style: Remove all context from diffs




commit 01aefaa5a4693cd2f1c15fb52d8b0b1875dc6790
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jul 13 14:22:43 2021 +0200

    check-style: Remove all context from diffs
    
    This avoids setting the uncrustify on/off code comments in the
    middle of surrounding code, and maybe breaking their style on the
    way. Reducing the context to 0 ensures these are right at the start
    and end lines of the function.

 check-style.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/check-style.py b/check-style.py
index df2ae4651..a4cf85612 100755
--- a/check-style.py
+++ b/check-style.py
@@ -8,7 +8,7 @@ import sys
 import tempfile
 
 def run_diff(sha):
-    proc = subprocess.Popen(["git", "diff", "--function-context", sha, "HEAD"], stdout=subprocess.PIPE, 
stderr=subprocess.STDOUT)
+    proc = subprocess.Popen(["git", "diff", "-U0", "--function-context", sha, "HEAD"], 
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
     files = proc.stdout.read().strip().decode('utf-8')
     return files.split('\n')
 


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