diff --git a/tools/docker-format/Dockerfile b/tools/docker-format/Dockerfile new file mode 100644 index 00000000..7023078b --- /dev/null +++ b/tools/docker-format/Dockerfile @@ -0,0 +1,8 @@ +FROM ubuntu:cosmic + +RUN apt update && \ + apt install -y clang-format golang git python-pip && \ + go get -v github.com/bazelbuild/buildtools/buildifier && \ + pip install cmake_format + +CMD ["/bin/bash"] diff --git a/tools/docker-format/README.md b/tools/docker-format/README.md new file mode 100644 index 00000000..241d6157 --- /dev/null +++ b/tools/docker-format/README.md @@ -0,0 +1,9 @@ +Docker container for automatic formatting. + +Usage: + +```shell +cd opencensus-cpp +docker build --tag opencensus-cpp/format tools/docker-format +docker run -v $PWD:/opencensus-cpp -it opencensus-cpp/format /opencensus-cpp/tools/docker-format/run.sh +``` diff --git a/tools/docker-format/run.sh b/tools/docker-format/run.sh new file mode 100755 index 00000000..250b304e --- /dev/null +++ b/tools/docker-format/run.sh @@ -0,0 +1,4 @@ +#!/bin/bash +export PATH=/root/go/bin:$PATH +cd /opencensus-cpp +tools/format.sh