File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-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+ - uses : actions/checkout@v2
11+ - run : | # adapted from https://github.com/JuliaLang/julia/blob/f5ce7c4cb9b3e2140819b6b089530ee69aea3d2f/contrib/check-whitespace.sh
12+ set -f # disable glob expansion in this script
13+ file_patterns='
14+ *.jl
15+ *.md
16+ *.toml
17+ *.yml
18+ '
19+
20+ # TODO: Look also for trailing empty lines, and missing '\n' after the last line
21+ if git --no-pager grep --color -n --full-name -e ' $' -- $file_patterns; then
22+ echo "Error: trailing whitespace found in source file(s)"
23+ echo ""
24+ echo "This can often be fixed with:"
25+ echo " git rebase --whitespace=fix HEAD~1"
26+ echo "or"
27+ echo " git rebase --whitespace=fix master"
28+ echo "and then a forced push of the correct branch"
29+ exit 1
30+ fi
31+
32+ echo "Whitespace check found no issues"
You can’t perform that action at this time.
0 commit comments