[tracker/wip/carlosg/code-style-checks] bar




commit cd7a39df6d262092ca4ccdc45ef211811f1b07a8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jun 14 01:21:43 2021 +0200

    bar

 .gitlab-ci.yml | 9 ++++++---
 check-style.py | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e0a63c3ef..005f6efc4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -181,12 +181,15 @@ check-code-style:
     - build-fedora-container@x86_64
   stage: code-review
   script:
-    - export common_parent_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list 
--first-parent "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list 
--first-parent HEAD) | head -1) ;
-      ./check-style.py --sha $common_parent_sha ;
+    - git fetch origin master;
+      export common_parent_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list 
--first-parent "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list 
--first-parent HEAD) | head -1) ;
+      python3 -u ./check-style.py --sha $common_parent_sha ;
       if [ $? -ne 0 ] ;
       then
         echo -e "Issue the following command in your local tree to apply the suggested changes (needs 
uncrustify installed):\n\n $ git rebase "origin/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}" 
--exec \"./check-style.py -r\" \n" ;
-      fi
+      else
+        echo -e "All looks good.\n" ;
+      fi;
   allow_failure: true
 
 .build-template: &build
diff --git a/check-style.py b/check-style.py
index 9ce886117..2edff3ca2 100755
--- a/check-style.py
+++ b/check-style.py
@@ -118,6 +118,7 @@ if rewrite is True:
     proc = subprocess.Popen(["git", "commit", "--all", "--amend", "-C", "HEAD"], stdout=subprocess.DEVNULL)
     os._exit(0)
 elif changed is True:
+    print ("\nIssue the following command in your local tree to apply the suggested changes (needs 
uncrustify installed):\n\n $ git rebase origin/master --exec \"./check-style.py -r\" \n")
     os._exit(-1)
 
 os._exit(0)


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