File: fix-trailing-whitespace.yml

package info (click to toggle)
simdjson 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 31,400 kB
  • sloc: cpp: 195,760; ansic: 20,954; sh: 1,126; python: 885; makefile: 47; ruby: 25; javascript: 13
file content (34 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Detect trailing whitespace

on: [push, pull_request]

jobs:
  whitespace:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - name: Remove whitespace and check the diff
        run: |
          set -eu
          scripts/remove_trailing_whitespace.sh
          git diff >whitespace.patch
          cat whitespace.patch
          if [ $(wc -c <whitespace.patch) -ne 0 ] ; then
             echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "
             echo "You have trailing whitespace, please download the artifact"
             echo "and apply with git apply <whitespace.patch or"
             echo "run scripts/remove_trailing_whitespace.sh locally."
             echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "
             exit 1
          else
             echo "no trailing whitespace found, good!"
          fi
      - name: Archive whitespace patch
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: whitespace-patch
          path: |
            whitespace.patch
          if-no-files-found: ignore