Skip to content

Commit 3080d33

Browse files
committed
action: final newline ci check
1 parent 3a641da commit 3080d33

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/osrd-ui-build.yml

+22
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,25 @@ jobs:
4545
}
4646
4747
commit_titles | TERM=xterm-color .github/scripts/check-commit-titles.sh
48+
49+
final_newline_lint:
50+
runs-on: ubuntu-latest
51+
name: Check final newline
52+
steps:
53+
- name: Install ripgrep
54+
run: sudo apt-get install -y ripgrep
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
- name: Check final newline is present
58+
run: |
59+
# search missing final newline
60+
if rg -Ul '[^\n]\z' -g '!*.svg' .; then
61+
echo "Found missing final newline on listed file(s)"
62+
exit 1
63+
fi
64+
65+
# search multiple final newlines
66+
if rg -Ul '\n\n\z' .; then
67+
echo "Found multiple final newlines on listed file(s)"
68+
exit 1
69+
fi

0 commit comments

Comments
 (0)