[tracker/wip/carlosg/code-style-checks] bar
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/code-style-checks] bar
- Date: Mon, 14 Jun 2021 00:59:35 +0000 (UTC)
commit f35d1a0cc7af13da5d99204b528b128675c0a943
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jun 14 01:21:43 2021 +0200
bar
.gitlab-ci.yml | 8 ++++++--
check-style.py | 4 ++++
2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e0a63c3ef..9d289b90c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -181,12 +181,16 @@ 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) ;
+ - git fetch origin ;
+ 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) ;
+ echo $common_parent_sha ;
./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..54028b899 100755
--- a/check-style.py
+++ b/check-style.py
@@ -106,12 +106,16 @@ parser.add_argument('--rewrite', '-r', type=bool,
action=argparse.BooleanOptionalAction,
help='Whether to amend the result to the last commit (e.g. \'git rebase --exec "%(prog)s
-r"\')')
+print ("Parse args")
args = parser.parse_args()
sha = args.sha or 'HEAD^'
rewrite = args.rewrite
+print ("Run diff")
diff = run_diff(sha)
+print ("Find chunks")
chunks = find_chunks(diff)
+print ("Reformat chunks")
changed = reformat_chunks(chunks, rewrite)
if rewrite is True:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]