From 44b9941c3f226d9521cee2fa20a934565279b598 Mon Sep 17 00:00:00 2001 From: Ron Green <11993626+georgettica@users.noreply.github.com> Date: Sun, 27 Dec 2020 18:18:24 +0200 Subject: [PATCH] feat(lint): make testing lint easier related to #1743 --- containerized_lint.sh | 6 ++++++ testing.Dockerfile | 12 ++++++++++++ 2 files changed, 18 insertions(+) create mode 100755 containerized_lint.sh create mode 100644 testing.Dockerfile diff --git a/containerized_lint.sh b/containerized_lint.sh new file mode 100755 index 00000000..9bc420d7 --- /dev/null +++ b/containerized_lint.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +CONTAINER_ENGINE=${CONTAINER_ENGINE:-docker} + +${CONTAINER_ENGINE} build --file ./testing.Dockerfile --tag test . +${CONTAINER_ENGINE} run --rm --interactive --tty --volume $(pwd -P):$(pwd) --workdir $(pwd) test bash ./lint_clean_files.sh diff --git a/testing.Dockerfile b/testing.Dockerfile new file mode 100644 index 00000000..a1b4a046 --- /dev/null +++ b/testing.Dockerfile @@ -0,0 +1,12 @@ +FROM fedora +RUN yum install --assumeyes \ + ShellCheck \ + python-devel \ + python \ + golang \ + pip \ + && \ + yum clean all +RUN pip3 install pre-commit +RUN GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt &&\ + ln -s ~/go/bin/shfmt /usr/local/bin