From bc1c52204377da5d960331f94622d253f8cda9ce Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 27 Dec 2020 21:45:46 +0200
Subject: [PATCH] Migration.

- Common pre-commit config from snippet.
- Migrate from Travis CI to GitLab CI.
- Convert README from reStructuredtext to markdown.
---
 .gitlab-ci.yml          |  4 ++++
 .pre-commit-config.yaml | 50 +++++++++++++++++++++++++++++++++-------
 .travis.yml             | 20 ----------------
 README.md               | 31 +++++++++++++++++++++++++
 README.rst              | 51 -----------------------------------------
 5 files changed, 77 insertions(+), 79 deletions(-)
 create mode 100644 .gitlab-ci.yml
 delete mode 100644 .travis.yml
 create mode 100644 README.md
 delete mode 100644 README.rst

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..f92da7b
--- /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 547fe6d..b8186f0 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 16af61e..0000000
--- 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 0000000..3b9655b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,31 @@
+# Shell pre-commit hooks
+
+[![pipeline status](https://git.shore.co.il/nimrod/shell-pre-commit/badges/master/pipeline.svg)](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 2949316..0000000
--- 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/.
-- 
GitLab