diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..f92da7b142f506a53baa2e4028ac3e501c5919d9 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,4 @@ +--- +include: + - project: shore/ci-templates + file: templates/pre-commit.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 547fe6d09cc62e44a700f0e9f64a0dda6055421e..b8186f0f1a3abc770559b17b8cc8d5796803115f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,47 @@ --- repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.3.0 + - repo: https://github.com/pre-commit/pre-commit-hooks.git + rev: v3.4.0 hooks: - - id: check-added-large-files - - id: check-yaml - - id: check-merge-conflict -- repo: https://git.shore.co.il/nimrod/shell-pre-commit.git + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-merge-conflict + - 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.25.0 + hooks: + - id: yamllint + + - repo: https://github.com/amperser/proselint/ + rev: 0.10.2 + hooks: + - id: proselint + types: [plain-text] + exclude: LICENSE + + - 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 - - id: shellcheck + - 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 16af61eb1f2d09ff9b48a659da8d641e2f3214cb..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -language: python -python: "3.6" -dist: trusty -sudo: false -group: beta -cache: - - pip - - directories: - - $HOME/.cache/ - -install: - - pip install pre_commit | cat - -script: - - pre-commit run --all-files - -notifications: - on_failure: never - email: false diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3b9655b2b37d27a8b7fd20fa4dbbaad6faf1fb4c --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Shell pre-commit hooks + +[](https://git.shore.co.il/nimrod/shell-pre-commit/-/commits/master) + +Shell [pre-commit](http://pre-commit.com/) hooks. + +## Usage + +Add the following to your `.pre-commit-config.yaml`: + +```yaml +- repo: https://git.shore.co.il/nimrod/shell-pre-commit.git + sha: v0.6.0 + hooks: + - id: shell-lint + - id: shellcheck +``` + +The minimal pre-commit version required is 0.15.0. The `shellcheck` hook +requires [shellcheck](https://www.shellcheck.net/) installed. + +## License + +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/expore/>. diff --git a/README.rst b/README.rst deleted file mode 100644 index 29493165530adf0c67e8a918352ceb5b5be2269f..0000000000000000000000000000000000000000 --- a/README.rst +++ /dev/null @@ -1,51 +0,0 @@ -Shell pre-commit hooks -###################### - -.. image:: https://travis-ci.org/adarnimrod/shell-pre-commit.svg?branch=master - :target: https://travis-ci.org/adarnimrod/shell-pre-commit - -Shell `pre-commit <http://pre-commit.com/>`_ hooks. - -Hooks ------ - -- :code: `shell-lint` - Runs :code:`/bin/sh -en` against identified shell - scripts. -- :code: `shellcheck` - Runs `shellcheck - <https://github.com/koalaman/shellcheck/>`_ agains identified shell scripts. - -Dependencies ------------- - -- :code: `/bin/sh` -- :code: `shellcheck` -- Pre-commit 0.15.0 or later. - -Installation ------------- - -Add the following to your :code:`.pre-commit-config.yaml`: - -.. code:: yaml - - - repo: https://git.shore.co.il/nimrod/shell-pre-commit.git - sha: v0.6.0 - hooks: - - id: shell-lint - - id: shellcheck - -And run :code:`pre-commit autoupdate` to update the hooks. - -License -------- - -This software is licensed under the MIT license (see the :code:`LICENSE.txt` -file). - -Author Information ------------------- - -Nimrod Adar, `contact me <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/.