Skip to contentSkip to conversation

gitlab: work harder to avoid false positives in checkpatch

RFC PATCH In review Alex Bennée 3 participants 3 messages Jun 2, 2021 – Jun 4, 2021

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 gitlab: work harder to avoid false positives in checkpatch

This copies the behaviour of patchew's configuration to make the diff algorithm generate a minimal diff.

---
 .gitlab-ci.d/static_checks.yml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
.gitlab-ci.d/static_checks.yml +5 -1
index 91247a6f67..ec09da799d 100644
@@ -3,7 +3,11 @@ check-patch:
   image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
   needs:
     job: amd64-centos8-container
-  script: .gitlab-ci.d/check-patch.py
+  script:
+    - git config --local diff.renamelimit 0
+    - git config --local diff.renames True
+    - git config --local diff.algorithm histogram
+    - .gitlab-ci.d/check-patch.py
   variables:
     GIT_DEPTH: 1000
   rules:
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Alex Bennée

Hi,

Quoted 2 lines · Alex Bennée

This copies the behaviour of patchew's configuration to make the diff algorithm generate a minimal diff.

I was intrigued on where you had found that configuration. Then I found it myself here:

https://patchew.org/logs/[email protected]/testing.checkpatch/?type=message

Assuming patchew has been doing the right thing, I think it is a good idea to configure Git alike on CI.

Thus:

Quoted 23 lines
---
  .gitlab-ci.d/static_checks.yml | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)
.gitlab-ci.d/static_checks.yml +5 -1
index 91247a6f67..ec09da799d 100644
@@ -3,7 +3,11 @@ check-patch:
    image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
    needs:
      job: amd64-centos8-container
-  script: .gitlab-ci.d/check-patch.py
+  script:
+    - git config --local diff.renamelimit 0
+    - git config --local diff.renames True
+    - git config --local diff.algorithm histogram
+    - .gitlab-ci.d/check-patch.py
    variables:
      GIT_DEPTH: 1000
    rules: