From 72a38c5d79a0dfc811cff50d9d2ae67994985816 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Thu, 7 Jan 2021 21:59:24 +0200
Subject: [PATCH] Updates.

- GitLab CI.
- Refresh pre-commit checks.
- Address some issues.
---
 .gitlab-ci.yml          | 23 ++++++++++
 .pre-commit-config.yaml | 98 ++++++++++++++++++++++++++++++++++++++---
 .travis.yml             | 20 ---------
 MANIFEST.in             |  5 +++
 README.rst              | 11 ++---
 setup.py                | 27 ++++++++++--
 6 files changed, 150 insertions(+), 34 deletions(-)
 create mode 100644 .gitlab-ci.yml
 delete mode 100644 .travis.yml
 create mode 100644 MANIFEST.in

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..637d82d
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,23 @@
+---
+include:
+  - project: shore/ci-templates
+    file: templates/pre-commit.yml
+
+install:
+  stage: test
+  image: python:$tag
+  before_script:
+    - pip install docutils pygments
+  script:
+    - python setup.py check --verbose --metadata --restructuredtext --strict
+    - pip install .
+  variables:
+    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
+  cache:
+    paths:
+      - .cache/
+  parallel:
+    matrix:
+      - tag:
+          - "2.7-slim"
+          - "3.6-slim"
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 030b17c..48a8f8b 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,7 +1,93 @@
--   repo: git://github.com/pre-commit/pre-commit-hooks
-    sha: cf550fcab3f12015f8676b8278b30e1a5bc10e70
+---
+repos:
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v3.4.0
     hooks:
-    -   id: check-added-large-files
-    -   id: check-yaml
-    -   id: check-merge-conflict
-    -   id: flake8
+      - id: check-executables-have-shebangs
+      - id: check-merge-conflict
+      - id: check-symlinks
+      - id: check-toml
+        files: Pipfile
+      - 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/ambv/black
+    rev: 20.8b1
+    hooks:
+      - id: black
+        args:
+          - |
+              --line-length=79
+
+  - repo: https://github.com/Lucas-C/pre-commit-hooks-markup
+    rev: v1.0.1
+    hooks:
+      - id: rst-linter
+
+  - repo: https://github.com/myint/rstcheck.git
+    rev: master
+    hooks:
+      - id: rstcheck
+
+  - repo: https://github.com/PyCQA/prospector
+    rev: 1.3.1
+    hooks:
+      - id: prospector
+        args:
+          - |-
+            --max-line-length=79
+          - |-
+            --with-tool=pyroma
+          - |-
+            --with-tool=bandit
+          - |-
+            --without-tool=pep257
+          - |-
+            --doc-warnings
+          - |-
+            --test-warnings
+          - |-
+            --full-pep8
+          - |-
+            --strictness=high
+          - |-
+            --no-autodetect
+        additional_dependencies:
+          - bandit
+          - pyroma
+
+  - repo: https://gitlab.com/pycqa/flake8.git
+    rev: 3.8.4
+    hooks:
+      - id: flake8
+        args:
+          - |-
+            --doctests
+        additional_dependencies:
+          - flake8-bugbear
+
+  - repo: https://github.com/mgedmin/check-manifest
+    rev: '0.45'
+    hooks:
+      - id: check-manifest
+
+  - 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 a0550aa..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-language: python
-python: ["2.7", "3.6"]
-dist: trusty
-sudo: false
-group: beta
-cache:
-  - pip
-  - directories:
-      - $HOME/.pre-commit
-
-install:
-  - pip install pre-commit
-
-script:
-  - pre-commit run --all-files
-  - pip install .
-
-notifications:
-  email: false
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..6095a8c
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,5 @@
+include *.txt
+include *.rst
+include VERSION
+exclude *.yml
+exclude *.yaml
diff --git a/README.rst b/README.rst
index fbe2ccf..a9aaa7d 100644
--- a/README.rst
+++ b/README.rst
@@ -1,8 +1,9 @@
 Python pre-commit hooks
 #######################
 
-.. image:: https://travis-ci.org/adarnimrod/python-pre-commit.svg?branch=master
-    :target: https://travis-ci.org/adarnimrod/python-pre-commit
+.. image:: https://git.shore.co.il/nimrod/python-pre-commit/badges/master/pipeline.svg
+    :target: https://git.shore.co.il/nimrod/python-pre-commit/-/commits/master
+    :alt: pipeline status
 
 Ansible `pre-commit <http://pre-commit.com/>`_ hooks.
 
@@ -16,9 +17,9 @@ Add the following to your :code:`.pre-commit-config.yaml`:
 .. code:: yaml
 
     - repo: https://git.shore.co.il/nimrod/python-pre-commit.git
-      sha: v0.2.0
+      rev: v0.2.0
       hooks:
-      - id: piprot
+        - id: piprot
 
 License
 -------
@@ -32,4 +33,4 @@ 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/nimrod/.
+at: https://git.shore.co.il/explore.
diff --git a/setup.py b/setup.py
index 5134384..0f06800 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,28 @@ from setuptools import setup
 
 
 setup(
-        name='pre_commit_python_dummy_package',
-        version=open('VERSION', 'r').read().strip(),
-        install_requires=['piprot', 'docutils'],
+    name="pre_commit_python_dummy_package",
+    version=open("VERSION", "r").read().strip(),
+    install_requires=["piprot", "docutils"],
+    description="Dummy package for installing with pre-commit.",
+    long_description=open("README.rst", "r").read(),
+    long_description_content_type="text/x-rst",
+    url="https://git.shore.co.il/nimrod/python-pre-commit",
+    author="Nimrod Adar",
+    author_email="nimrod@shore.co.il",
+    license="MIT",
+    classifiers=[
+        "Development Status :: 4 - Beta",
+        "Intended Audience :: System Administrators",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.6",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 2",
+        "Programming Language :: Python :: 2.7",
+        "Topic :: Utilities",
+        "License :: OSI Approved :: MIT License",
+    ],
+    keywords="pre-commit",
 )
-- 
GitLab