Allow running this repo as a pre-commit hook

This commit is contained in:
Vidar Holen
2021-08-28 21:19:45 -07:00
parent 081f7eba24
commit 9d64d78c32
4 changed files with 57 additions and 6 deletions

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
# This file builds ShellCheck for pre-commit.
#
# It may also be useful for local development, but it is notably NOT
# used to build the official ShellCheck docker images.
FROM ubuntu:20.04
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y cabal-install
RUN cabal update
# Install dependencies separately for more efficient iteration
COPY ShellCheck.cabal /build/
RUN cd /build && cabal install --dependencies-only
# Now build the rest
COPY . /build/
RUN cd /build && cabal build shellcheck
RUN find /build -type f -name shellcheck -perm /111 -exec cp -f {} /bin \;
ENTRYPOINT ["/bin/shellcheck"]