From b01c75af0fd03abb5745d2b7e16511eb08354912 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 28 Jan 2024 13:12:46 +0100 Subject: [PATCH] Changes to use docformatter --- .github/workflows/test_docs.yml | 2 +- .github/workflows/test_tox.yml | 6 +++--- config/dpkg/changelog | 4 ++-- dfwinreg/__init__.py | 6 +++--- docs/conf.py | 1 + pyproject.toml | 7 +++++++ setup.cfg | 2 +- tox.ini | 13 ++++++++++++- utils/update_release.sh | 2 +- 9 files changed, 31 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml index 25d48a3..23d1116 100644 --- a/.github/workflows/test_docs.yml +++ b/.github/workflows/test_docs.yml @@ -36,7 +36,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox diff --git a/.github/workflows/test_tox.yml b/.github/workflows/test_tox.yml index 05d3487..195554a 100644 --- a/.github/workflows/test_tox.yml +++ b/.github/workflows/test_tox.yml @@ -46,7 +46,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox @@ -82,7 +82,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox @@ -120,7 +120,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv libcreg-python3 libregf-python3 python3-dfdatetime python3-distutils python3-dtfabric python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox diff --git a/config/dpkg/changelog b/config/dpkg/changelog index f1873d1..ee4b952 100644 --- a/config/dpkg/changelog +++ b/config/dpkg/changelog @@ -1,5 +1,5 @@ -dfwinreg (20240113-1) unstable; urgency=low +dfwinreg (20240128-1) unstable; urgency=low * Auto-generated - -- Log2Timeline maintainers Sat, 13 Jan 2024 10:06:41 +0100 + -- Log2Timeline maintainers Sun, 28 Jan 2024 13:09:20 +0100 diff --git a/dfwinreg/__init__.py b/dfwinreg/__init__.py index 06a80aa..948ab23 100644 --- a/dfwinreg/__init__.py +++ b/dfwinreg/__init__.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- """Digital Forensics Windows Registry (dfWinReg). -dfWinReg, or Digital Forensics Windows Registry, is a Python module -that provides read-only access to Windows Registry objects. +dfWinReg, or Digital Forensics Windows Registry, is a Python module that +provides read-only access to Windows Registry objects. """ -__version__ = '20240113' +__version__ = '20240128' diff --git a/docs/conf.py b/docs/conf.py index 6ab3bcd..1a9e389 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -52,6 +52,7 @@ # docstrings. napoleon_google_docstring = True napoleon_numpy_docstring = False +napoleon_include_init_with_doc = True napoleon_include_private_with_doc = False napoleon_include_special_with_doc = True diff --git a/pyproject.toml b/pyproject.toml index 9787c3b..038528a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,10 @@ [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" + +[tool.docformatter] +black = false +non-cap = ["dfDateTime", "dfImageTools", "dfVFS", "dfWinReg"] +non-strict = false +wrap-summaries = 80 +wrap-descriptions = 80 diff --git a/setup.cfg b/setup.cfg index 8513ae6..56fb6d3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dfwinreg -version = 20240113 +version = 20240128 description = Digital Forensics Windows Registry (dfWinReg). long_description = dfWinReg, or Digital Forensics Windows Registry, provides read-only access to Windows Registry objects. The goal of dfWinReg is to provide a generic interface for accessing Windows Registry objects that resembles the Registry key hierarchy as seen on a live Windows system. long_description_content_type = text/plain diff --git a/tox.ini b/tox.ini index c10ef43..459d602 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3{7,8,9,10,11,12},coverage,docs,lint,wheel +envlist = py3{7,8,9,10,11,12},coverage,docformatter,docs,lint,wheel [testenv] allowlist_externals = ./run_tests.py @@ -25,6 +25,13 @@ commands = coverage: coverage xml wheel: python -m build --no-isolation --wheel +[testenv:docformatter] +usedevelop = True +deps = + docformatter +commands = + docformatter --in-place --recursive dfwinreg tests + [testenv:docs] usedevelop = True deps = @@ -45,10 +52,14 @@ setenv = deps = -rrequirements.txt -rtest_requirements.txt + docformatter pylint >= 3.0.0, < 3.1.0 + setuptools yamllint >= 1.26.0 commands = + docformatter --version pylint --version yamllint -v + docformatter --check --diff --recursive dfwinreg setup.py tests pylint --rcfile=.pylintrc dfwinreg setup.py tests yamllint -c .yamllint.yaml dfwinreg diff --git a/utils/update_release.sh b/utils/update_release.sh index 18b72ce..dfe47af 100755 --- a/utils/update_release.sh +++ b/utils/update_release.sh @@ -25,7 +25,7 @@ dfwinreg (${VERSION}-1) unstable; urgency=low EOT # Regenerate the API documentation. -tox -edocs +tox -edocformatter,docs exit ${EXIT_SUCCESS};