diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-07-18 12:33:14 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-18 12:33:14 +0000 |
| commit | 27a3d2cd0b8a4adf8a4beef4be6c18ed96b21d2c (patch) | |
| tree | 07bba56ac60667c8a63776fda9acef0583751f65 /.github | |
| parent | 13964c7fca1fe387d502a0044014f276147bc6e6 (diff) | |
| parent | 10f59667879bc476004c78bc0d3d6a0c4f560e55 (diff) | |
Merge pull request #1669 from embassy-rs/nocrlf
ci: add check for no CRLF line endings.
Diffstat (limited to '.github')
| -rwxr-xr-x | .github/ci/crlf.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.github/ci/crlf.sh b/.github/ci/crlf.sh new file mode 100755 index 000000000..457510407 --- /dev/null +++ b/.github/ci/crlf.sh | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | ## on push branch~=gh-readonly-queue/main/.* | ||
| 3 | ## on pull_request | ||
| 4 | |||
| 5 | set -euo pipefail | ||
| 6 | |||
| 7 | FILES_WITH_CRLF=$(find ! -path "./.git/*" -not -type d | xargs file -N | (grep " CRLF " || true)) | ||
| 8 | |||
| 9 | if [ -z "$FILES_WITH_CRLF" ]; then | ||
| 10 | echo -e "No files with CRLF endings found." | ||
| 11 | exit 0 | ||
| 12 | else | ||
| 13 | NR_FILES=$(echo "$FILES_WITH_CRLF" | wc -l) | ||
| 14 | echo -e "ERROR: Found ${NR_FILES} files with CRLF endings." | ||
| 15 | echo "$FILES_WITH_CRLF" | ||
| 16 | exit "$NR_FILES" | ||
| 17 | fi \ No newline at end of file | ||
