[epiphany] CI: Add code style validation to pipeline



commit 3c1984f5b8e95b84b8de8aeeff004926ea95a992
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Tue Jul 16 17:55:06 2019 +0200

    CI: Add code style validation to pipeline

 .gitlab-ci.yml        | 8 ++++++++
 data/check-code-style | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ae91587b0..93b2d5c47 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,13 @@
 include: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
 
+check-code-style:
+  stage: 'build'
+  image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
+  before_script:
+    - dnf install -y uncrustify
+  script:
+    - data/check-code-style
+
 variables:
   BUNDLE: 'epiphany-git.flatpak'
 
diff --git a/data/check-code-style b/data/check-code-style
index 86885e224..5e26eb6c0 100755
--- a/data/check-code-style
+++ b/data/check-code-style
@@ -30,7 +30,7 @@ do
    # Aligning prototypes is not working yet, so avoid headers
    for FILE in $(find "$DIR" -name "*.c" ! -path "*/contrib/*")
     do
-        "$UNCRUSTIFY" -c "data/uncrustify.cfg" --no-backup "$FILE"
+        "$UNCRUSTIFY" -c "data/uncrustify.cfg" -f "$FILE" -o "$FILE.uncrustify"
         "$LINEUP_PARAMETERS" "$FILE.uncrustify" > "$FILE.temp" && mv "$FILE.temp" "$FILE.uncrustify"
         diff -urN "$FILE" "$FILE.uncrustify" | \
             sed -e "1s|--- |--- a/|" -e "2s|+++ |+++ b/|" >> "$patch"


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