|
|
|
#!/bin/sh
|
|
|
|
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
IFS='
|
|
|
|
'
|
|
|
|
|
|
|
|
cp -rT /app /jail
|
|
|
|
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
if test "$EXPECTED_FILES"; then
|
|
|
|
echo -n 'Formatting (with `goimports -d .`) ... '
|
|
|
|
cd /jail/student
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
s=$(goimports -d .)
|
|
|
|
if test "$s"; then
|
|
|
|
echo
|
|
|
|
echo "$s"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo OK
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
if test "$ALLOWED_FUNCTIONS"; then
|
|
|
|
rc "$EXPECTED_FILES" $ALLOWED_FUNCTIONS
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd /jail
|
|
|
|
|
|
|
|
if ! test -f ${EXERCISE}_test.go; then
|
|
|
|
echo No test file found for the exercise : "$EXERCISE"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# TODO: maybe change btree exercises so that they work without student code and then delete this line
|
|
|
|
find . -name '*_test.go' ! -name ${EXERCISE}_test.go -delete
|
Refactor & Beautify & destruction commit
return early, remove else branches, reorder conditions and top-level functions, remove empty lines, remove unnecessary append(), fix typos, stop using testing package, remove dead code, fix mistakes in subjects, tests and solutions, remove disclaimers, reformat comments, simplify solutions, tests, add more instructions to subjects, remove obsolete files, etc.
Some of the reasons behind those modifications will be added to good-practices.en.md
Some of the exercises are now broken, they will have to be fixed, most of them have a "TODO:" comment.
5 years ago
|
|
|
go test -failfast '-run=(?i)'test${EXERCISE}
|