diff --git a/.gitignore b/.gitignore index af205c69..fa102155 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ build AUTHORS ChangeLog +dist diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..1ffc437a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +--- +default_language_version: + # force all unspecified python hooks to run python3 + python: python3 +repos: + - repo: local + hooks: + - id: twine-check + name: twine-check + entry: tools/twine-check.sh + language: python + types: [python] + additional_dependencies: [twine] + args: ['--strict'] + exclude: ^$ # don't run on empty files + - repo: https://github.com/sphinx-contrib/sphinx-lint + rev: v0.9.1 + hooks: + - id: sphinx-lint + args: [--enable=default-role] + files: ^README.rst + types: [rst] + diff --git a/tools/twine-check.sh b/tools/twine-check.sh new file mode 100755 index 00000000..3221faca --- /dev/null +++ b/tools/twine-check.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# build dist tarball +python setup.py sdist +# check dist tarball +twine check dist/*