From 449c05f429b237a069297fc494fb97759e05df49 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Fri, 17 Sep 2021 06:50:36 +0300
Subject: [PATCH] Pre-commit updates and fixes.

- New, updated or migrated pre-commit hooks.
- Fix found issues.
---
 .pre-commit-config.yaml | 47 +++++++++++++++++++++++++++++------------
 cgit/README.md          |  2 +-
 sshd/Dockerfile         |  2 ++
 3 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 4baed11..2eb5f80 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,49 +1,68 @@
 ---
 repos:
   - repo: https://github.com/pre-commit/pre-commit-hooks.git
-    rev: v3.4.0
+    rev: v4.0.1
     hooks:
       - id: check-added-large-files
       - id: check-executables-have-shebangs
+      - id: check-json
       - id: check-merge-conflict
+      - id: check-shebang-scripts-are-executable
       - id: check-symlinks
+      - id: check-toml
+      - id: check-xml
+      - id: check-yaml
+      - id: detect-private-key
+      - id: end-of-file-fixer
       - id: trailing-whitespace
-        exclude: .\.diff$
+        exclude: \.diff$
 
-  - repo: https://github.com/Yelp/detect-secrets
+  - repo: https://github.com/codespell-project/codespell.git
+    rev: v2.1.0
+    hooks:
+      - id: codespell
+
+  - repo: https://github.com/Yelp/detect-secrets.git
     rev: v1.1.0
     hooks:
       - id: detect-secrets
 
-  - repo: https://github.com/adrienverge/yamllint
-    rev: v1.26.1
+  - repo: https://gitlab.com/devopshq/gitlab-ci-linter.git
+    rev: v1.0.4
     hooks:
-      - id: yamllint
+      - id: gitlab-ci-linter
+        args:
+          - "--server"
+          - https://git.shore.co.il
 
-  - repo: https://github.com/amperser/proselint/
+  - repo: https://github.com/amperser/proselint.git
     rev: 0.10.2
     hooks:
       - id: proselint
         types: [plain-text]
         exclude: LICENSE
 
+  - repo: https://github.com/adrienverge/yamllint.git
+    rev: v1.26.3
+    hooks:
+      - id: yamllint
+
   - repo: https://github.com/executablebooks/mdformat.git
-    rev: 0.7.4
+    rev: 0.7.9
     hooks:
       - id: mdformat
 
-  - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git
-    rev: v0.6.0
+  - repo: https://git.shore.co.il/nimrod/pre-commit-hooks.git
+    rev: v0.1.0
     hooks:
-      - id: shell-lint
+      - id: shell-validate
 
   - repo: https://github.com/shellcheck-py/shellcheck-py.git
     rev: v0.7.2.1
     hooks:
       - id: shellcheck
 
-  - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/
-    rev: v0.3.0
+  - repo: https://github.com/AleksaC/hadolint-py.git
+    rev: v2.1.0
     hooks:
       - id: hadolint
-      - id: docker-compose
diff --git a/cgit/README.md b/cgit/README.md
index a4f4e4d..ca4d627 100644
--- a/cgit/README.md
+++ b/cgit/README.md
@@ -7,7 +7,7 @@ cgit container image.
 This container runs Apache that is configured with cgit at `/cgit`. It exposes
 port 80 and serves the repositories under `/srv/git`. The container runs as
 a limited user (`www-data`), so make sure to have the content of `/srv/git`
-readble by it. Also, if you wish to persist the cache, the location is
+readable by it. Also, if you wish to persist the cache, the location is
 `/var/cache/cgit`.
 
 ## Example
diff --git a/sshd/Dockerfile b/sshd/Dockerfile
index 3dd2a2a..297902c 100644
--- a/sshd/Dockerfile
+++ b/sshd/Dockerfile
@@ -1,5 +1,7 @@
 ARG BASEIMAGE=debian:testing-slim
+# hadolint ignore=DL3006
 FROM ${BASEIMAGE}
+# hadolint ignore=DL3008
 RUN apt-get update && \
     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
         netcat-openbsd \
-- 
GitLab