-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
60cd2ab
commit 4df6aae
Showing
3 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y apt-utils && \ | ||
apt-get install -y curl git flake8 libtinfo5 && \ | ||
RUN apt update && \ | ||
DEBIAN_FRONTEND="noninteractive" apt upgrade -y --no-install-recommends && \ | ||
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \ | ||
apt-utils \ | ||
ca-certificates \ | ||
clang-format-7 \ | ||
curl \ | ||
flake8 \ | ||
git \ | ||
libtinfo5 \ | ||
shellcheck \ | ||
&& \ | ||
apt-get clean | ||
|
||
RUN curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/clang+llvm-7.1.0-x86_64-linux-gnu-ubuntu-14.04.tar.xz | tar -C /opt -xJv && \ | ||
mv /opt/clang* /opt/llvm-7.1.0 | ||
ENV PATH=/opt/llvm-7.1.0/bin:$PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "---------- Begin ENV ----------" | ||
env | sort | ||
echo "---------- End ENV ----------" | ||
|
||
# If a source dir is given, then change to it. Otherwise assume we're already | ||
# in it | ||
if [ -n "${SOURCE_DIR}" ] | ||
then | ||
cd "${SOURCE_DIR}" || exit | ||
fi | ||
|
||
# Check C and C++ code with shellcheck | ||
found_scripts=$(find scripts -regextype posix-extended -iregex '.*\.(sh|bash)' -print) | ||
found_scripts+=$(git grep --name-only -e '#!/{usr/,}bin/{bash,sh}' -e '#!/{usr/,}bin/env {bash,sh}') | ||
found_scripts=$(sort -u <<<"$found_scripts") | ||
|
||
if ! xargs -n1 shellcheck <<<"$found_scripts" | ||
then | ||
echo "shellcheck:" | ||
echo " Code format checks failed." | ||
echo " Please run shellcheck on your changes before committing." | ||
exit 1 | ||
fi | ||
|
||
exit 0 |