Skip to content

Commit 5e3a7fc

Browse files
add CRLF check
1 parent 2b92481 commit 5e3a7fc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
2323
task --version
2424
25+
- name: Check for CRLF line endings
26+
run: |
27+
task list-crlf
28+
2529
- name: Verify CHANGELOG.md was updated
2630
run: |
2731
task check-changelog

Taskfile.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ tasks:
4444
validate:
4545
desc: Runs all checks and updates the docu. It is recommended to do this before making a commit.
4646
cmds:
47+
- task: list-crlf
4748
- task: check-changelog
4849
- task: check-version
4950
- task: tests
@@ -65,6 +66,17 @@ tasks:
6566
- pdoc -o docs pedantic
6667
silent: true
6768

69+
list-crlf:
70+
desc: List all Python files with CRLF line endings
71+
silent: true
72+
cmds:
73+
- |
74+
files=$(find . -type d -name ".*" ! -name "." -prune -o -name "*.py" -type f -exec grep -Iq . {} \; -and -exec grep -l $'\r' {} \;)
75+
if [ -n "$files" ]; then
76+
echo "$files"
77+
exit 1
78+
fi
79+
6880
check-changelog:
6981
desc: Fails if CHANGELOG.md was not modified compared to master
7082
silent: true

0 commit comments

Comments
 (0)