File tree Expand file tree Collapse file tree 6 files changed +25
-5
lines changed
Expand file tree Collapse file tree 6 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e -u -o pipefail
4+
5+ ret=0
6+ show=0
7+ # Reference: https://medium.com/@alexey.inkin/how-to-force-newline-at-end-of-files-and-why-you-should-do-it-fdf76d1d090e
8+ while IFS= read -rd ' ' f; do
9+ if file --mime-encoding " $f " | grep -qv binary; then
10+ tail -c1 < " $f " | read -r _ || show=1
11+ if [ $show -eq 1 ]; then
12+ echo " Warning: No newline at end of file $f "
13+ ret=1
14+ show=0
15+ fi
16+ fi
17+ done < <( git ls-files -z src tests/arch-test-target)
18+
19+ exit $ret
Original file line number Diff line number Diff line change 3737 - name : coding convention
3838 run : |
3939 sudo apt-get install -q -y clang-format-14
40- sh .ci/check-format.sh
40+ .ci/check-newline.sh
41+ .ci/check-format.sh
4142 shell : bash
Original file line number Diff line number Diff line change @@ -80,4 +80,4 @@ def main(argv):
8080 print ("ERROR: qtest is not exist" )
8181 exit (1 )
8282
83- main (args )
83+ main (args )
Original file line number Diff line number Diff line change 2222 [38;5;89m⎺[7m⎽[0m[38;5;125;48;5;125m⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽⎽[38;5;131m⎽[0m [0m
2323 [38;5;53m⎺[7m[38;5;89m⎽[0m[38;5;125;48;5;125m⎽⎽⎽⎽⎽⎽⎽⎽⎽[38;5;131;48;5;238m⎺[0m [0m
2424 [7m[38;5;52m⎽[0m[38;5;131;48;5;53m⎼[38;5;138;48;5;89m⎽[38;5;168;48;5;125m⎽[38;5;174m⎽[0m[7m[38;5;89m⎽[38;5;53m⎽[0m[38;5;240m⎺[0m [0m
25- [?25h
25+ [?25h
Original file line number Diff line number Diff line change @@ -21,4 +21,4 @@ reverse
2121rh z
2222rh r
2323rh r
24- rh n
24+ rh n
Original file line number Diff line number Diff line change 3434rh b
3535rh c
3636rh a
37- rh a
37+ rh a
You can’t perform that action at this time.
0 commit comments