Skip to content

Make check-whitespace failures more helpful

Chris. Webster via GitGitGadget git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 5 repliesIn review
  2. v12 patches 6 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ci (check-whitespace): suggest fixes for errors.github/workflows/check-whitespace.yml+28 -95 replies
2/3ci (check-whitespace): add links to job output.github/workflows/check-whitespace.yml+25 -90 replies
3/3ci (check-whitespace): move to actions/checkout@v3.github/workflows/check-whitespace.yml+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] Make check-whitespace failures more helpful

Add the errors to the job summary along with suggested commands to fix the problem. The commits and filenames are links.

This is for issue #1395. Sample job output
[https://github.com/webstech/check-whitespace/actions/runs/3707382446]:

❌ A whitespace issue was found in one or more of the commits.

Run these commands to correct the problem:

1. git rebase --whitespace=fix aaa04a9
2. git push --force

Errors:

1. --- 5cd37f6 Remove annotations
trailing.txt:4: trailing whitespace.
+
trailing.txt:2: new blank line at EOF.

Chris. Webster (3):
ci (check-whitespace): suggest fixes for errors ci (check-whitespace): add links to job output ci (check-whitespace): move to actions/checkout@v3

 .github/workflows/check-whitespace.yml | 57 +++++++++++++++++++++-----
 1 file changed, 46 insertions(+), 11 deletions(-)

base-commit: 57e2c6ebbe7108b35ba30184dcbcb6c34c929ad8
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1444%2Fwebstech%2Fwhitespace-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1444/webstech/whitespace-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1444

Range-diff vs v1:

1: 67f60e4e5cb ! 1: a2b5f3e87d6 Make check-whitespace failures more helpful
@@ Metadata
Author: Chris. Webster <[email protected]>

## Commit message ##
- Make check-whitespace failures more helpful
+ ci (check-whitespace): suggest fixes for errors

- Add the errors to the job summary along with suggested
- commands to fix the problem.
+ Make the errors more visible by adding them to the job summary and
+ display the git commands that will usually fix the problem.

## .github/workflows/check-whitespace.yml ##
@@ .github/workflows/check-whitespace.yml: jobs:
- check-whitespace:
- runs-on: ubuntu-latest
- steps:
-- - uses: actions/checkout@v2
-+ - uses: actions/checkout@v3
- with:
- fetch-depth: 0
-
- name: git log --check
id: check_out
run: |
2: cdc2b1aae81 ! 2: 342167ef5bd Improve check-whitespace output
@@ Metadata
Author: Chris. Webster <[email protected]>

## Commit message ##
- Improve check-whitespace output
+ ci (check-whitespace): add links to job output

A message in the step log will refer to the Summary output.

- The job summary output now has links to the commits and files.
+ The job summary output is using markdown to improve readability. The
+ git commands and commits with errors are now in ordered lists.
+ Commits and files in error are links to the user's repository.

-: ----------- > 3: aa8cd940940 ci (check-whitespace): move to actions/checkout@v3

Signature · 1 line
gitgitgadget