diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23796b52625068807a771bcd515d96cc3905ef3e..c8c2fedbf7b221d439a0634a5e415fe0dd3bf332 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,8 @@ --- +include: + - project: shore/ci-templates + file: templates/pre-commit.yml + image: adarnimrod/ci-images:docker stages: @@ -6,20 +10,6 @@ stages: - build - run -pre-commit: - stage: test - image: adarnimrod/ci-images:pre-commit - variables: - XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache" - # Disabled until https://github.com/pre-commit/pre-commit/issues/1387 is - # resolved. - SKIP: "hadolint,docker-compose" - script: - - pre-commit run --all-files - cache: - paths: - - .cache/ - build: stage: build tags: ["host01.shore.co.il"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37d0c7afac464e4c553b41640e71ee71ab4ce761..13d68fd1fc7fdca9e758d5db887f1b23ee812b77 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,21 @@ -# vim:ff=unix ts=2 sw=2 ai expandtab --- repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + - repo: https://github.com/pre-commit/pre-commit-hooks.git + rev: v3.4.0 hooks: - id: check-added-large-files + - id: check-executables-have-shebangs - id: check-merge-conflict - - id: detect-private-key + - id: check-symlinks - id: trailing-whitespace + - repo: https://github.com/Yelp/detect-secrets + rev: v0.14.3 + hooks: + - id: detect-secrets + - repo: https://github.com/adrienverge/yamllint - rev: v1.17.0 + rev: v1.25.0 hooks: - id: yamllint @@ -21,13 +26,23 @@ repos: types: [plain-text] exclude: LICENSE - - repo: https://github.com/Yelp/detect-secrets - rev: v0.13.0 + - repo: https://github.com/executablebooks/mdformat.git + rev: 0.5.3 hooks: - - id: detect-secrets + - id: mdformat + + - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git + rev: v0.6.0 + hooks: + - id: shell-lint + + - repo: https://github.com/shellcheck-py/shellcheck-py.git + rev: v0.7.1.1 + hooks: + - id: shellcheck - repo: https://git.shore.co.il/nimrod/docker-pre-commit.git/ rev: v0.3.0 hooks: - - id: docker-compose - id: hadolint + - id: docker-compose