diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3ff2e3594eaefd49f4f969e6981b4876ede8b504..ab7f3718a334313b4397306962af3aab4fafc0bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,7 @@ --- -- repo: git://github.com/pre-commit/pre-commit-hooks - sha: v0.7.1 +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + sha: v1.1.1 hooks: - id: check-added-large-files - id: check-yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml deleted file mode 120000 index 4641bf3cbe1336d757e3bf0cde6690e210f612f9..0000000000000000000000000000000000000000 --- a/.pre-commit-hooks.yaml +++ /dev/null @@ -1 +0,0 @@ -hooks.yaml \ No newline at end of file diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7786864b6dc3521effbc8d173db678ab8e40dbfe --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,16 @@ +--- +- id: shell-lint + name: Lint shell scripts + description: Run /bin/sh -en against shell scripts. + language: script + entry: ./shell-lint + types: [shell] + minimum_pre_commit_version: 0.15.0 # Because of types. +- id: shellcheck + name: shellcheck + description: A shell script static analysis tool + language: system + entry: shellcheck + args: ['--external-sources'] + types: [shell] + minimum_pre_commit_version: 0.15.0 # Because of types. diff --git a/README.rst b/README.rst index 4ad93089feb82047cc8d10e63268e028e1a3871f..7b16d9883596e886901d273e69e724cba6c14a8f 100644 --- a/README.rst +++ b/README.rst @@ -1,17 +1,25 @@ -Shell lint pre-commit hook -########################## +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 lint `pre-commit <http://pre-commit.com/>`_ hook. The hook runs -:code:`/bin/sh -en` against found shell scripts. +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` -- Pre-commit +- :code: `/bin/sh` +- :code: `shellcheck` +- Pre-commit 0.15.0 or later. Installation ------------ @@ -21,7 +29,7 @@ Add the following to your :code:`.pre-commit-config.yaml`: .. code:: yaml - repo: https://www.shore.co.il/git/shell-pre-commit/ - sha: v0.4.0 + sha: v0.6.0 hooks: - id: shell-lint - id: shellcheck diff --git a/VERSION b/VERSION index 167b000b4d3c7c3dac98df16da9d14c916efc852..09a3acfa138db01dc50a688796b2861638c369ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.4 \ No newline at end of file +0.6.0 \ No newline at end of file diff --git a/hooks.yaml b/hooks.yaml deleted file mode 100644 index 74771c9ed8c56984531f167e5206ede200a2ce04..0000000000000000000000000000000000000000 --- a/hooks.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- id: shell-lint - name: Lint shell scripts - description: Run /bin/sh -en against shell scripts. - language: script - entry: ./shell-lint - files: &shell_scripts \.(sh|bash|ksh|zsh)$ -- id: shellcheck - name: shellcheck - description: A shell script static analysis tool - language: system - entry: shellcheck - args: ['--external-sources'] - files: *shell_scripts