Commit 2ed70812 authored by nimrod's avatar nimrod
Browse files

Pre-commit.

- Added pre-commit hooks.
- Silence a few warnings.
parent 75c0725a
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
# vim:ff=unix ts=2 sw=2 ai expandtab
---
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
      - id: check-added-large-files
      - id: check-executables-have-shebangs
      - id: check-merge-conflict
      - id: detect-private-key
      - id: trailing-whitespace
        exclude: \.diff$
  - repo: https://github.com/adrienverge/yamllint
    rev: v1.17.0
    hooks:
      - id: yamllint
  - repo: https://github.com/amperser/proselint/
    rev: 0.10.2
    hooks:
      - id: proselint
        types: [plain-text]
        exclude: LICENSE
  - repo: https://www.shore.co.il/git/shell-pre-commit/
    rev: v0.6.0
    hooks:
      - id: shell-lint
      - id: shellcheck
  - repo: https://www.shore.co.il/git/docker-pre-commit
    rev: v0.3.0
    hooks:
      - id: hadolint
      - id: docker-compose
+1 −0
Original line number Diff line number Diff line
FROM debian:stretch-slim
# hadolint ignore=DL3008
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        clamav-daemon \
+2 −0
Original line number Diff line number Diff line
FROM docker:18.09 as docker

# hadolint ignore=DL3006
FROM adarnimrod/cron as supersonic
COPY --from=docker /usr/local/bin/docker /usr/local/bin/
COPY --chown=root:root crontab /crontab
# hadolint ignore=DL3002
USER root
+1 −0
Original line number Diff line number Diff line
FROM debian:stretch-slim
# hadolint ignore=DL3008
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        gnupg \
+1 −0
Original line number Diff line number Diff line
#!/bin/sh
set -eux

# shellcheck disable=SC2044
for user in $(find /var/mail -maxdepth 1 -mindepth 1 -type d)
do
    sa-learn --spam --mbox --forget "$user/Junk" || true