mirror of
https://github.com/github/gitignore.git
synced 2026-11-14 05:41:50 +01:00
Preserve literal carriage returns with dos2unix
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
4b3bc35bc8
commit
5686bb8cb6
1 file changed
+9
-3
@@ -27,6 +27,11 @@ jobs:
|
||||
- name: Install formatting tools
|
||||
run: python -m pip install pre-commit-hooks==6.0.0
|
||||
|
||||
- name: Install dos2unix
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --yes dos2unix
|
||||
|
||||
- name: Check all gitignore files recursively
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -41,13 +46,14 @@ jobs:
|
||||
echo "Checking ${#files[@]} gitignore files."
|
||||
|
||||
status=0
|
||||
mixed-line-ending --fix=lf -- "${files[@]}" || status=1
|
||||
dos2unix --keep-bom -- "${files[@]}" || status=1
|
||||
trailing-whitespace-fixer -- "${files[@]}" || status=1
|
||||
end-of-file-fixer -- "${files[@]}" || status=1
|
||||
|
||||
git --no-pager diff --no-ext-diff --exit-code -- "${files[@]}" || status=1
|
||||
|
||||
if (( status != 0 )); then
|
||||
echo "::error::Formatting checks failed. See tool output and diff below."
|
||||
git --no-pager diff --no-ext-diff -- "${files[@]}"
|
||||
echo "::error::Formatting checks failed. See tool output and diff above."
|
||||
fi
|
||||
|
||||
exit "$status"
|
||||
Reference in new issue
Block a user