From a1ec91319ad1f67fff838a576745626ff06fc025 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 21 Dec 2018 03:53:38 +0100 Subject: [PATCH] Slight improvements to the code formatter. --- tools/code-format/Dockerfile | 4 ++-- tools/code-format/format.sh | 2 +- tools/code-format/run-format.sh | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/code-format/Dockerfile b/tools/code-format/Dockerfile index cab819de..8cca05da 100644 --- a/tools/code-format/Dockerfile +++ b/tools/code-format/Dockerfile @@ -12,8 +12,8 @@ FROM ubuntu:18.04 AS run RUN apt-get -y update RUN apt-get -y install apt-utils RUN apt-get -y dist-upgrade -RUN apt-get -y install clang-format +RUN apt-get -y install clang-format tofrodos COPY --from=build /bin/tabremover /bin COPY run-format.sh . -CMD ["bash"] +CMD ["/run-format.sh"] diff --git a/tools/code-format/format.sh b/tools/code-format/format.sh index 0f6c5868..39793143 100755 --- a/tools/code-format/format.sh +++ b/tools/code-format/format.sh @@ -3,4 +3,4 @@ cd $(dirname $0)/../.. docker build -t code-format tools/code-format -docker run --rm=true -v "$(pwd)":/repository --user "$(id -u):$(id -g)" -t code-format /run-format.sh +docker run --rm=true -v "$(pwd)":/repository --user "$(id -u):$(id -g)" -t code-format diff --git a/tools/code-format/run-format.sh b/tools/code-format/run-format.sh index ed17ff6d..12a6b4bd 100755 --- a/tools/code-format/run-format.sh +++ b/tools/code-format/run-format.sh @@ -4,6 +4,7 @@ cd repository/src find . -name *.c -or -name *.cc -or -name *.h | while read f ; do echo "$f" + fromdos "$f" tabremover -t 8 "$f" "$f".2 mv "$f.2" "$f" clang-format --style=file "$f" > "$f.2"