From: Justin Tobler <jltobler@gmail.com>
To: git@vger.kernel.org
Cc: Justin Tobler <jltobler@gmail.com>, ps@pks.im
Subject: [PATCH v3 0/5] Add GitLab CI to check for whitespace errors
Date: Fri, 3 May 2024 12:21:02 -0500 [thread overview]
Message-ID: <20240503172110.181326-1-jltobler@gmail.com> (raw)
In-Reply-To: <20240502193840.105355-1-jltobler@gmail.com>
Hello again,
This is the third version of my patch series to add a GitLab CI job to
check for whitespace errors.
Changes since V2:
- In 35e293e6 (Merge branch 'ps/ci-test-with-jgit' into next,
2024-05-01), `install-docker-dependencies.sh` script was merged into
`install-dependencies.sh` and removed. Thus this patch series now
depends on that change and is updated to use the other script.
- Changed the shebang to "#!/usr/bin/env bash".
- Made the argument count validation more strict.
- Fixed a typo.
GitHub CI:
- https://github.com/gitgitgadget/git/actions/runs/8941666020?pr=1727
- https://github.com/gitgitgadget/git/actions/runs/8941721282?pr=1727
GitLab CI:
- https://gitlab.com/gitlab-org/git/-/jobs/6776032414
- https://gitlab.com/gitlab-org/git/-/jobs/6776038234
Thanks for the reviews,
-Justin
Justin Tobler (5):
ci: pre-collapse GitLab CI sections
github-ci: fix link to whitespace error
ci: separate whitespace check script
ci: make the whitespace report optional
gitlab-ci: add whitespace error check
.github/workflows/check-whitespace.yml | 67 ++----------------
.gitlab-ci.yml | 9 +++
ci/check-whitespace.sh | 95 ++++++++++++++++++++++++++
ci/lib.sh | 2 +-
4 files changed, 109 insertions(+), 64 deletions(-)
create mode 100755 ci/check-whitespace.sh
Range-diff against v2:
1: 924d3eb23c = 1: 924d3eb23c ci: pre-collapse GitLab CI sections
2: c8d8b444dc = 2: c8d8b444dc github-ci: fix link to whitespace error
3: 6b44b21dda ! 3: 933e0c33f9 ci: separate whitespace check script
@@ .github/workflows/check-whitespace.yml: jobs:
## ci/check-whitespace.sh (new) ##
@@
-+#!/bin/bash
++#!/usr/bin/env bash
+
+baseCommit=$1
+outputFile=$2
4: 87dfd1d5a9 ! 4: 374735c60f ci: make the whitespace report optional
@@ Commit message
## ci/check-whitespace.sh ##
@@
- #!/bin/bash
+ #!/usr/bin/env bash
+#
+# Check that commits after a specified point do not contain new or modified
+# lines with whitespace errors. An optional formatted summary can be generated
@@ ci/check-whitespace.sh
outputFile=$2
url=$3
-+if test "$#" -eq 0 || test "$#" -gt 3
++if test "$#" -ne 1 && test "$#" -ne 3
+then
+ echo "USAGE: $0 <BASE_COMMIT> [<OUTPUT_FILE> <URL>]"
+ exit 1
@@ ci/check-whitespace.sh: then
+ echo "Run the following command to resolve whitespace issues:"
+ echo "git rebase --whitespace=fix ${goodParent}"
+
-+ # If target output file is provided, write formatted ouput.
++ # If target output file is provided, write formatted output.
+ if test -n "$outputFile"
+ then
+ echo "🛑 Please review the Summary output for further information."
5: 175b300e91 ! 5: a7deaeadc7 gitlab-ci: add whitespace error check
@@ .gitlab-ci.yml: static-analysis:
+check-whitespace:
+ image: ubuntu:latest
+ before_script:
-+ - ./ci/install-docker-dependencies.sh
++ - ./ci/install-dependencies.sh
+ script:
+ - ./ci/check-whitespace.sh "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA"
+ rules:
--
2.45.0
next prev parent reply other threads:[~2024-05-03 17:23 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 0:33 [PATCH 0/2] Add GitLab CI to check for whitespace errors Justin Tobler
2024-04-30 0:33 ` [PATCH 1/2] ci: pre-collapse GitLab CI sections Justin Tobler
2024-04-30 0:33 ` [PATCH 2/2] gitlab-ci: add whitespace error check Justin Tobler
2024-04-30 1:59 ` James Liu
2024-04-30 3:01 ` Justin Tobler
2024-04-30 5:04 ` Patrick Steinhardt
2024-04-30 5:04 ` Patrick Steinhardt
2024-04-30 12:14 ` Taylor Blau
2024-04-30 14:00 ` Justin Tobler
2024-04-30 14:05 ` Patrick Steinhardt
2024-04-30 14:41 ` Justin Tobler
2024-04-30 14:45 ` Patrick Steinhardt
2024-04-30 14:58 ` Justin Tobler
2024-05-02 19:38 ` [PATCH v2 0/5] Add GitLab CI to check for whitespace errors Justin Tobler
2024-05-02 19:38 ` [PATCH v2 1/5] ci: pre-collapse GitLab CI sections Justin Tobler
2024-05-02 19:38 ` [PATCH v2 2/5] github-ci: fix link to whitespace error Justin Tobler
2024-05-02 19:38 ` [PATCH v2 3/5] ci: separate whitespace check script Justin Tobler
2024-05-03 6:56 ` Patrick Steinhardt
2024-05-03 15:27 ` Justin Tobler
2024-05-03 16:49 ` Junio C Hamano
2024-05-03 17:59 ` Patrick Steinhardt
2024-05-04 6:51 ` Chris Torek
2024-05-02 19:38 ` [PATCH v2 4/5] ci: make the whitespace report optional Justin Tobler
2024-05-03 6:56 ` Patrick Steinhardt
2024-05-03 15:35 ` Justin Tobler
2024-05-02 19:38 ` [PATCH v2 5/5] gitlab-ci: add whitespace error check Justin Tobler
2024-05-03 6:56 ` Patrick Steinhardt
2024-05-02 21:45 ` [PATCH v2 0/5] Add GitLab CI to check for whitespace errors Junio C Hamano
2024-05-03 15:39 ` Justin Tobler
2024-05-03 17:21 ` Justin Tobler [this message]
2024-05-03 17:21 ` [PATCH v3 1/5] ci: pre-collapse GitLab CI sections Justin Tobler
2024-05-03 17:21 ` [PATCH v3 2/5] github-ci: fix link to whitespace error Justin Tobler
2024-05-03 17:21 ` [PATCH v3 3/5] ci: separate whitespace check script Justin Tobler
2024-05-03 17:21 ` [PATCH v3 4/5] ci: make the whitespace report optional Justin Tobler
2024-05-03 17:21 ` [PATCH v3 5/5] gitlab-ci: add whitespace error check Justin Tobler
2024-05-06 6:55 ` Patrick Steinhardt
2024-05-06 13:59 ` Justin Tobler
2024-05-06 17:17 ` Junio C Hamano
2024-05-06 19:21 ` Justin Tobler
2024-05-07 4:12 ` Patrick Steinhardt
2024-05-07 18:06 ` Justin Tobler
2024-05-07 18:12 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240503172110.181326-1-jltobler@gmail.com \
--to=jltobler@gmail.com \
--cc=git@vger.kernel.org \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).