[tracker/wip/carlosg/code-style-checks: 4/4] ci: Check code style in merge request changes
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/code-style-checks: 4/4] ci: Check code style in merge request changes
- Date: Wed, 16 Jun 2021 23:01:30 +0000 (UTC)
commit 775aee5be2e1e8cb7bde68786fac0dc3a04a3de6
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Jun 13 20:58:20 2021 +0200
ci: Check code style in merge request changes
Use the new check-style script to check the code style for all
changes in a merge request, in order to suggest changes to conform
to it.
However, allow these checks to fail, so they are more of a hint
while the uncrustify configuration is tested to be correct, we
decide to enforce the style, etc.
As the script requires uncrustify, ensure it's installed in the
Fedora image, and use it to run the check.
.gitlab-ci.yml | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2cb98c926..01b2bd597 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -16,6 +16,7 @@ variables:
stages:
- review
- prepare
+ - code-review
- build
- test
- analysis
@@ -59,9 +60,9 @@ check-merge-request:
.tracker.fedora@common:
variables:
- BASE_TAG: '2021-05-15.9'
+ BASE_TAG: '2021-06-13.2'
FDO_UPSTREAM_REPO: GNOME/tracker
- FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip
umockdev-devel xmlto'
+ FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip
umockdev-devel xmlto uncrustify patch diffutils'
FDO_DISTRIBUTION_EXEC: |
dnf install -y 'dnf-command(builddep)' &&
dnf builddep -y tracker tracker-miners --setopt=install_weak_deps=False &&
@@ -172,6 +173,19 @@ build-alpine-container@x86_64:
- check-commit-log
- check-merge-request
+check-code-style:
+ extends:
+ - .fdo.distribution-image@fedora
+ - .tracker.fedora:34@x86_64
+ needs:
+ - build-fedora-container@x86_64
+ stage: code-review
+ script:
+ - 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 --dry-run --sha $common_parent_sha ;
+ allow_failure: true
+
.build-template: &build
stage: build
script:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]