From 9c8cd0e08be255ff57964cc5710cde107be9191b Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sat, 16 May 2026 09:34:36 +0200 Subject: [PATCH] Changes to add docformatter configuration --- dfdatetime/__init__.py | 4 ++-- dfdatetime/dotnet_datetime.py | 8 ++++---- dfdatetime/precisions.py | 4 ++-- pyproject.toml | 5 +++++ tox.ini | 20 ++++++++++++++++++-- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/dfdatetime/__init__.py b/dfdatetime/__init__.py index b669649..8a3efac 100644 --- a/dfdatetime/__init__.py +++ b/dfdatetime/__init__.py @@ -1,7 +1,7 @@ """Digital Forensics Date and Time (dfDateTime). -dfDateTime, or Digital Forensics date and time, provides date and time objects -to preserve accuracy and precision. +dfDateTime, or Digital Forensics date and time, provides date and time objects to +preserve accuracy and precision. """ # Imports for date time values factory. diff --git a/dfdatetime/dotnet_datetime.py b/dfdatetime/dotnet_datetime.py index df2ef16..8ccd603 100644 --- a/dfdatetime/dotnet_datetime.py +++ b/dfdatetime/dotnet_datetime.py @@ -18,9 +18,9 @@ def __init__(self): class DotNetDateTime(interface.DateTimeValues): """.NET DateTime ticks. - The .NET DateTime timestamp is a 64-bit signed integer that contains the date - and time as the number of 100 nanoseconds since 12:00 AM January 1, year 1 - A.D. in the proleptic Gregorian Calendar. + The .NET DateTime timestamp is a 64-bit signed integer that contains the date and + time as the number of 100 nanoseconds since 12:00 AM January 1, year 1 A.D. in the + proleptic Gregorian Calendar. """ _EPOCH = DotNetDateTimeEpoch() @@ -48,7 +48,7 @@ def __init__(self, precision=None, time_zone_offset=None, timestamp=None): @property def timestamp(self): - """integer: .NET DateTime timestamp or None if not set.""" + """int: .NET DateTime timestamp or None if not set.""" return self._timestamp def _GetNormalizedTimestamp(self): diff --git a/dfdatetime/precisions.py b/dfdatetime/precisions.py index e437cb8..f9c5ed8 100644 --- a/dfdatetime/precisions.py +++ b/dfdatetime/precisions.py @@ -10,8 +10,8 @@ class DateTimePrecisionHelper: This is the super class of different date and time precision helpers. - Time precision helpers provide functionality for converting date and time - values between different precisions. + Time precision helpers provide functionality for converting date and time values + between different precisions. """ # pylint: disable=missing-raises-doc,redundant-returns-doc diff --git a/pyproject.toml b/pyproject.toml index aa4e20c..5d2f4c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,5 +28,10 @@ line-length = 88 target-version = ["py310"] include = "\\.pyi?$" +[tool.docformatter] +black = true +non-cap = ["bytes:", "dfDateTime", "float:", "int:", "str:"] +non-strict = true + [tool.setuptools] package-dir = {"dfdatetime" = "dfdatetime"} diff --git a/tox.ini b/tox.ini index 2c3b69e..6f16baa 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3{10,11,12,13,14},black,coverage,docs,pylint,wheel +envlist = py3{10,11,12,13,14},black,coverage,docformatter,docs,pylint,wheel [testenv] allowlist_externals = ./run_tests.py @@ -37,7 +37,23 @@ deps = setuptools >= 65 commands = black --version - black --check . + black . + +[testenv:docformatter] +skipsdist = True +pip_pre = True +passenv = + CFLAGS + CPPFLAGS + LDFLAGS +setenv = + PYTHONPATH = {toxinidir} +deps = + docformatter + setuptools >= 65 +commands = + docformatter --version + docformatter --in-place --recursive dfdatetime tests [testenv:docs] usedevelop = True