File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
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 examples)
18
+
19
+ exit $ret
Original file line number Diff line number Diff line change 26
26
sudo apt-get install -q -y clang-format-12
27
27
sudo apt-get install -q -y cppcheck
28
28
sudo apt-get install -q -y gcc-11
29
+ .ci/check-newline.sh
29
30
.ci/check-format.sh
30
31
.ci/static-analysis.sh
31
32
.ci/build-n-run.sh
Original file line number Diff line number Diff line change @@ -95,4 +95,4 @@ SpacesInParentheses: false
95
95
SpacesInSquareBrackets : false
96
96
Standard : Cpp03
97
97
TabWidth : 4
98
- UseTab : Never
98
+ UseTab : Never
You can’t perform that action at this time.
0 commit comments