Merge "add twine check and pre-commit"

This commit is contained in:
Zuul 2024-04-29 19:07:40 +00:00 committed by Gerrit Code Review
commit 2fb8e27cad
3 changed files with 29 additions and 0 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@
build
AUTHORS
ChangeLog
dist

23
.pre-commit-config.yaml Normal file
View File

@ -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]

5
tools/twine-check.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
# build dist tarball
python setup.py sdist
# check dist tarball
twine check dist/*