forked from SevenTV/chatterino7
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dockerfile for checking formatting
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu:19.10 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get -y install clang-format | ||
|
||
WORKDIR /build | ||
|
||
CMD ["/bin/sh"] | ||
ENTRYPOINT ["./tools/docker/build.sh"] |
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,19 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
fail="0" | ||
|
||
while read -r file; do | ||
if ! diff -u <(cat "$file") <(clang-format "$file"); then | ||
echo "$file differs!!!!!!!" | ||
fail="1" | ||
fi | ||
done < <(find src/ \( -iname "*.hpp" -o -iname "*.cpp" \)) | ||
|
||
if [ "$fail" = "1" ]; then | ||
echo "At least one file is poorly formatted - check the output above" | ||
exit 1 | ||
fi | ||
|
||
echo "Everything seems to be formatted properly! Good job" |