File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Whitespace Check
2
+ # Run only on pull requests
3
+ on :
4
+ pull_request :
5
+ jobs :
6
+ check-whitespace :
7
+ name : Check Whitespace
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - run : | # adapted from https://github.com/JuliaLang/julia/blob/f5ce7c4cb9b3e2140819b6b089530ee69aea3d2f/contrib/check-whitespace.sh
11
+ set -f # disable glob expansion in this script
12
+ file_patterns='
13
+ *.jl
14
+ *.md
15
+ *.toml
16
+ *.yml
17
+ '
18
+
19
+ # TODO: Look also for trailing empty lines, and missing '\n' after the last line
20
+ if git --no-pager grep --color -n --full-name -e ' $' -- $file_patterns; then
21
+ echo "Error: trailing whitespace found in source file(s)"
22
+ echo ""
23
+ echo "This can often be fixed with:"
24
+ echo " git rebase --whitespace=fix HEAD~1"
25
+ echo "or"
26
+ echo " git rebase --whitespace=fix master"
27
+ echo "and then a forced push of the correct branch"
28
+ exit 1
29
+ fi
30
+
31
+ echo "Whitespace check found no issues"
You can’t perform that action at this time.
0 commit comments