From 5683fc93721951a786994caebba579a25bb0a7eb Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 28 Jan 2017 14:24:19 +0200
Subject: [PATCH] - Added reStructuredText and metadata in setup.py checks
 (WIP).

---
 .pre-commit-config.yaml |  5 +++++
 README.rst              |  5 +++++
 hooks.yaml              | 12 ++++++++++++
 3 files changed, 22 insertions(+)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 030b17c..5960fd3 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -5,3 +5,8 @@
     -   id: check-yaml
     -   id: check-merge-conflict
     -   id: flake8
+-   repo: ./
+    sha: HEAD
+    hooks:
+    -   id: reStructuredText
+    -   id: metadata
diff --git a/README.rst b/README.rst
index 8ece22c..952e6a4 100644
--- a/README.rst
+++ b/README.rst
@@ -7,6 +7,9 @@ Python pre-commit hooks
 Ansible `pre-commit <http://pre-commit.com/>`_ hooks.
 
 - :code:`piprot`: Checks your requirements files for out of date packages.
+- :code:`metadata`: Verifies the meta-data in :code:`setup.py`.
+- :code:`reStructuredText`: Checks if long string meta-data syntax are
+  reStructuredText-compliant.
 
 Installation
 ------------
@@ -19,6 +22,8 @@ Add the following to your :code:`.pre-commit-config.yaml`:
       sha: v0.1.0
       hooks:
       - id: piprot
+      - id: metadata
+      - id: reStructuredText
 
 License
 -------
diff --git a/hooks.yaml b/hooks.yaml
index 84e445f..c244962 100644
--- a/hooks.yaml
+++ b/hooks.yaml
@@ -6,3 +6,15 @@
   entry: piprot
   args: ['--outdated']
   files: 'requirements.*\.txt$'
+- id: reStructuredText
+  name: Checks if long string meta-data syntax are reStructuredText-compliant.
+  language: python
+  entry: python
+  args: ['setup.py', 'check', '--strict', '--restructuredtext', '--']
+  files: setup\.py
+- id: metadata
+  name: Verify meta-data
+  language: python
+  entry: python
+  args: ['setup.py', 'check', '--strict', '--metadata', '--']
+  files: setup\.py
-- 
GitLab