diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..1f0ae5373d2dfb2efde4317e8b6f1f1d56062bc6 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,6 @@ +--- +include: + - project: shore/ci-templates + file: templates/pre-commit.yml + - project: shore/ci-templates + file: templates/pre-commit-repo.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8745d23059d16ac02bea21d204b5ac0878453456..571ea6a0c1829816e06e677b9977944f63e35cf9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,29 +1,51 @@ -# vim:ff=unix ts=2 sw=2 ai expandtab --- repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.2.3 + - 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.16.0 + rev: v1.25.0 hooks: - id: yamllint - - repo: https://github.com/amperser/proselint + + - 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/ + + - repo: https://github.com/executablebooks/mdformat.git + rev: 0.5.3 + hooks: + - 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://github.com/pre-commit/pre-commit.git + rev: v2.9.3 + hooks: + - id: validate_manifest + - repo: local hooks: - id: hadolint @@ -33,11 +55,3 @@ repos: language: script entry: pre-commit-docker-wrapper args: [hadolint] - - id: dockerfile-lint - name: dockerfile-lint - description: A rule based 'linter' for Dockerfiles - minimum_pre_commit_version: '0.18.0' - types: [dockerfile] - language: script - entry: pre-commit-docker-wrapper - args: [hadolint] diff --git a/Dockerfile b/Dockerfile index 0097ee61b604ee42fda896119443c8babf9b592b..b2424fa9a72e9c00879962ae4ac1ee15bd152043 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,5 +17,3 @@ RUN apk add --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpin hadolint --version COPY docker-compose-config dockerfile-lint /usr/local/bin/ USER nobody -LABEL Name docker-pre-commit -LABEL Version 0.3.0 diff --git a/README.md b/README.md index 9cbd250a19177bdc4ddad13416258242425c0365..e0d9be387af6d32903448fb214c9e768bb115987 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Docker pre-commmit +[](https://git.shore.co.il/nimrod/docker-pre-commit/-/commits/master) + > Pre-commit hooks for Docker and docker-compose. ## Requirements @@ -7,13 +9,6 @@ - [Docker](https://www.docker.com/). - [pre-commit](https://pre-commit.com/) 0.18.0 or later. -## Hooks - -- `hadolint` - The [hadolint](https://github.com/hadolint/hadolint) Dockerfile - linter. -- `docker-compose` - Validate the Docker Compose file using `docker-compose - config`. - ## Usage example ```yaml @@ -31,7 +26,7 @@ This software is licensed under the MIT license (see `LICENSE.txt`). ## Author Information -Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my [website]( -https://www.shore.co.il/). Patches are welcome via [`git send-email`]( -http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is located -at: <https://git.shore.co.il/nimrod/>. +Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my +[website](https://www.shore.co.il/). Patches are welcome via +[`git send-email`](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository +is located at: <https://git.shore.co.il/expore/>.