1- FROM python:3-slim
1+ FROM ghcr.io/super-linter/super-linter:latest
22
33# This Dockerfile is used by the linting pre-commit hook.
44# Unfortunately there is no config option yet to specify the name or path
55# of this image, so it must be on root level simply named Dockerfile...
66
7- RUN apt-get update && apt-get install jq wget -y
7+ RUN apk add jq wget
88RUN pip install --upgrade pip yq virtualenv toml-union
99
1010# Copy linting workflow to identify linter versions if needed
@@ -22,3 +22,31 @@ RUN pip install -r requirements.txt
2222COPY pre_commit_hooks/linting.sh /linting.sh
2323
2424CMD [ "bash /linting.sh" ]
25+
26+ # Below for super-linter
27+
28+ # pre-commit seems to set too strict permissions:
29+ # error: could not lock config file //.gitconfig: Permission denied
30+ # Therefore do not configure globally
31+ # https://github.com/super-linter/super-linter/blob/main/lib/linter.sh#L345
32+ RUN sed -i 's+git config --global --add safe.directory+git config --add safe.directory+g' /action/lib/linter.sh
33+
34+ # save to be able to export later
35+ RUN echo "RUN_LOCAL=TRUE" >> /super-linter.txt
36+ RUN echo "DEFAULT_BRANCH=main" >> /super-linter.txt
37+ RUN echo "DEFAULT_WORKSPACE=/src" >> /super-linter.txt
38+ RUN echo BASH_SEVERITY=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."BASH_SEVERITY"' .default) >> /super-linter.txt
39+ RUN echo VALIDATE_BASH=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_BASH"' .default) >> /super-linter.txt
40+ RUN echo VALIDATE_BASH_EXEC=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_BASH_EXEC"' .default) >> /super-linter.txt
41+ RUN echo VALIDATE_CSS=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_CSS"' .default) >> /super-linter.txt
42+ RUN echo VALIDATE_DOCKERFILE_HADOLINT=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_DOCKERFILE_HADOLINT"' .default) >> /super-linter.txt
43+ RUN echo VALIDATE_GITHUB_ACTIONS=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_GITHUB_ACTIONS"' .default) >> /super-linter.txt
44+ RUN echo VALIDATE_HTML=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_HTML"' .default) >> /super-linter.txt
45+ RUN echo VALIDATE_JAVASCRIPT_ES=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_JAVASCRIPT_ES"' .default) >> /super-linter.txt
46+ RUN echo VALIDATE_JAVASCRIPT_STANDARD=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_JAVASCRIPT_STANDARD"' .default) >> /super-linter.txt
47+ RUN echo VALIDATE_JSON=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_JSON"' .default) >> /super-linter.txt
48+ RUN echo VALIDATE_MARKDOWN=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_MARKDOWN"' .default) >> /super-linter.txt
49+ RUN echo VALIDATE_POWERSHELL=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_POWERSHELL"' .default) >> /super-linter.txt
50+ RUN echo VALIDATE_RENOVATE=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_RENOVATE"' .default) >> /super-linter.txt
51+ RUN echo VALIDATE_XML=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_XML"' .default) >> /super-linter.txt
52+ RUN echo VALIDATE_YAML=$(cat $WORKFLOW_LINTING_WORKFLOW | yq .on.workflow_call.inputs | jq -r '."VALIDATE_YAML"' .default) >> /super-linter.txt
0 commit comments