diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 030b17c568f98b8d7889d6d114aaf383ca46850c..5960fd35de7f3251ce6f544878d10c652d25a3ab 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 8ece22c6a6c609bc6f0dfd716dc22bb7c0081ad1..952e6a4f8c16717b6fac97bcb600090662ad3fc0 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 84e445fbe62f103945900832ab07d833ef6240d0..c2449627a66d76e920c972fbd8f19c3066775063 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