File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : check-codestyle
2+ on :
3+ pull_request :
4+
5+ jobs :
6+ check-codestyle :
7+ strategy :
8+ fail-fast : false
9+ runs-on : ubuntu-latest
10+ name : check codestyle
11+ steps :
12+ - uses : actions/checkout@v2
13+ - name : Check core codestyle
14+ run : source ./codestyle.sh
15+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ echo " Codestyle check script:"
5+ echo
6+
7+ declare -A singleLineRegexChecks=(
8+ [" [[:blank:]]$" ]=" Remove whitespace at the end of the lines above"
9+ [" \t" ]=" Replace tabs with 4 spaces in the lines above"
10+ )
11+
12+ for check in ${! singleLineRegexChecks[@]} ; do
13+ echo " Checking RegEx: '${check} '"
14+
15+ if grep -P -r -I -n ${check} exercises/ | grep .cpp; then
16+ echo
17+ echo " ${singleLineRegexChecks[$check]} "
18+ exit 1
19+ fi
20+ done
21+
22+ echo
23+ echo " Everything looks good"
You can’t perform that action at this time.
0 commit comments