git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 0/5] Add GitLab CI to check for whitespace errors

From
Justin Tobler <jltobler@gmail.com>
Date
May 3, 2024, 17:21 UTC
Message-ID
<20240503172110.181326-1-jltobler@gmail.com>
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
Previous: Justin ToblerNext: Justin Tobler
Message 30 of 42 in “Add GitLab CI to check for whitespace errors”
  1. 0/2 Add GitLab CI to check for whitespace errorsJustin Tobler, Apr 30, 2024
  2. 1/2 ci: pre-collapse GitLab CI sectionsJustin Tobler, Apr 30, 2024
  3. 2/2 gitlab-ci: add whitespace error checkJustin Tobler, Apr 30, 2024
  4. James LiuApr 30, 2024
  5. Justin ToblerApr 30, 2024
  6. Patrick SteinhardtApr 30, 2024
  7. Patrick SteinhardtApr 30, 2024
  8. Taylor BlauApr 30, 2024
  9. Justin ToblerApr 30, 2024
  10. Patrick SteinhardtApr 30, 2024
  11. Justin ToblerApr 30, 2024
  12. Patrick SteinhardtApr 30, 2024
  13. Justin ToblerApr 30, 2024
  14. 0/5 Add GitLab CI to check for whitespace errorsJustin Tobler, May 2, 2024
  15. 1/5 ci: pre-collapse GitLab CI sectionsJustin Tobler, May 2, 2024
  16. 2/5 github-ci: fix link to whitespace errorJustin Tobler, May 2, 2024
  17. 3/5 ci: separate whitespace check scriptJustin Tobler, May 2, 2024
  18. Patrick SteinhardtMay 3, 2024
  19. Justin ToblerMay 3, 2024
  20. Junio C HamanoMay 3, 2024
  21. Patrick SteinhardtMay 3, 2024
  22. Chris TorekMay 4, 2024
  23. 4/5 ci: make the whitespace report optionalJustin Tobler, May 2, 2024
  24. Patrick SteinhardtMay 3, 2024
  25. Justin ToblerMay 3, 2024
  26. 5/5 gitlab-ci: add whitespace error checkJustin Tobler, May 2, 2024
  27. Patrick SteinhardtMay 3, 2024
  28. Junio C HamanoMay 2, 2024
  29. Justin ToblerMay 3, 2024
  30. 0/5 Add GitLab CI to check for whitespace errorsJustin Tobler, May 3, 2024
  31. 1/5 ci: pre-collapse GitLab CI sectionsJustin Tobler, May 3, 2024
  32. 2/5 github-ci: fix link to whitespace errorJustin Tobler, May 3, 2024
  33. 3/5 ci: separate whitespace check scriptJustin Tobler, May 3, 2024
  34. 4/5 ci: make the whitespace report optionalJustin Tobler, May 3, 2024
  35. 5/5 gitlab-ci: add whitespace error checkJustin Tobler, May 3, 2024
  36. Patrick SteinhardtMay 6, 2024
  37. Justin ToblerMay 6, 2024
  38. Junio C HamanoMay 6, 2024
  39. Justin ToblerMay 6, 2024
  40. Patrick SteinhardtMay 7, 2024
  41. Justin ToblerMay 7, 2024
  42. Patrick SteinhardtMay 7, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.