diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..637d82dfc528ac27001e939c7335842d3ccfbb01 --- /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 030b17c568f98b8d7889d6d114aaf383ca46850c..48a8f8baef3fab7acf664c2e9d1a86d701731629 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 a0550aa635c1c82aefe7c667a4d294eadaae149a..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..6095a8c4aed6a89c2b10787a52756b8499b32cce --- /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 fbe2ccf77dc775b97ee702a8f23ab060742cd9f3..a9aaa7d91cf2d399bbd2d163f02480147eb4b80f 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 5134384366f99e5fb4e167493f79f9bc625b5de4..0f0680099effd18eb4acf46204aa487879178c5d 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", )