diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,51 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.4.0 + hooks: + - id: trailing-whitespace + - id: check-json + - id: check-yaml + +- repo: https://gitlab.com/pycqa/flake8 + rev: 3.8.3 + hooks: + - id: flake8 + +- repo: https://github.com/codespell-project/codespell + rev: v1.16.0 + hooks: + - id: codespell + exclude: ^(swh/loader/package/.*[/]+tests/data/.*)$ + entry: codespell --ignore-words-list=iff + +- repo: local + hooks: + - id: mypy + name: mypy + entry: mypy + args: [swh] + pass_filenames: false + language: system + types: [python] + +- repo: https://github.com/PyCQA/isort + rev: 5.5.2 + hooks: + - id: isort + +- repo: https://github.com/python/black + rev: 19.10b0 + hooks: + - id: black + +# unfortunately, we are far from being able to enable this... +# - repo: https://github.com/PyCQA/pydocstyle.git +# rev: 4.0.0 +# hooks: +# - id: pydocstyle +# name: pydocstyle +# description: pydocstyle is a static analysis tool for checking compliance with Python docstring conventions. +# entry: pydocstyle --convention=google +# language: python +# types: [python] + diff --git a/docs/README.rst b/docs/README.rst --- a/docs/README.rst +++ b/docs/README.rst @@ -1,15 +1,4 @@ -.. _swh-loader-bzr: - Software Heritage - Bazaar/Breezy loader ======================================== Loader for `Bazaar `_ and `Breezy `_ repositories. Breezy is a friendly fork of Bazaar that supports the Bazaar file format and network protocol. - - -Reference Documentation ------------------------ - -.. toctree:: - :maxdepth: 2 - - /apidoc/swh.loader.bzr diff --git a/docs/index.rst b/docs/index.rst --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -.. _swh-py-template: +.. _swh-loader-bzr: .. include:: README.rst @@ -6,6 +6,7 @@ :maxdepth: 2 :caption: Contents: + how-bzr-works Indices and tables ------------------ diff --git a/swh/__init__.py b/swh/__init__.py --- a/swh/__init__.py +++ b/swh/__init__.py @@ -1,4 +1,3 @@ from pkgutil import extend_path -from typing import Iterable -__path__: Iterable[str] = extend_path(__path__, __name__) +__path__ = extend_path(__path__, __name__)