From ad52b35c2f69753abb21e073f5f9b04472b7cee1 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 28 Jan 2024 09:13:39 +0100 Subject: [PATCH] Changes to use docformatter --- config/dpkg/changelog | 4 ++-- dfdatetime/__init__.py | 6 +++--- dfdatetime/dotnet_datetime.py | 4 ++-- dfdatetime/interface.py | 12 +++--------- dfdatetime/systemtime.py | 12 ++++++------ pyproject.toml | 7 +++++++ setup.cfg | 2 +- tox.ini | 5 +++++ 8 files changed, 29 insertions(+), 23 deletions(-) diff --git a/config/dpkg/changelog b/config/dpkg/changelog index 595c270..b5e49b6 100644 --- a/config/dpkg/changelog +++ b/config/dpkg/changelog @@ -1,5 +1,5 @@ -dfdatetime (20240113-1) unstable; urgency=low +dfdatetime (20240128-1) unstable; urgency=low * Auto-generated - -- Log2Timeline maintainers Sat, 13 Jan 2024 09:23:13 +0100 + -- Log2Timeline maintainers Sun, 28 Jan 2024 09:19:21 +0100 diff --git a/dfdatetime/__init__.py b/dfdatetime/__init__.py index 91502fb..a9ff9ac 100644 --- a/dfdatetime/__init__.py +++ b/dfdatetime/__init__.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- """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. @@ -25,4 +25,4 @@ from dfdatetime import webkit_time -__version__ = '20240113' +__version__ = '20240128' diff --git a/dfdatetime/dotnet_datetime.py b/dfdatetime/dotnet_datetime.py index 73e13c9..cf824eb 100644 --- a/dfdatetime/dotnet_datetime.py +++ b/dfdatetime/dotnet_datetime.py @@ -20,8 +20,8 @@ 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. + 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() diff --git a/dfdatetime/interface.py b/dfdatetime/interface.py index 1fc57d1..cc17739 100644 --- a/dfdatetime/interface.py +++ b/dfdatetime/interface.py @@ -112,23 +112,17 @@ def __init__(self, is_delta=False, precision=None, time_zone_offset=None): @property def is_delta(self): - """is_delta (bool): True if the date and time value is relative to another - date and time value. - """ + """Is delta (bool): True if the date and time is relative to another.""" return self._is_delta @property def precision(self): - """precision (str): precision of the date and time value, which should - be one of the PRECISION_VALUES in definitions. - """ + """Precision (str): precision of the date and time value.""" return self._precision @property def time_zone_offset(self): - """time_zone_offset (int): time zone offset in number of minutes from UTC - or None if not set. - """ + """Time zone offset (int): time zone offset in minutes from UTC.""" return self._time_zone_offset @time_zone_offset.setter diff --git a/dfdatetime/systemtime.py b/dfdatetime/systemtime.py index d37b135..6de82d3 100644 --- a/dfdatetime/systemtime.py +++ b/dfdatetime/systemtime.py @@ -111,32 +111,32 @@ def day_of_week(self): @property def hours(self): - """hours (int): hours, 0 through 23.""" + """Hours (int): hours, 0 through 23.""" return self._hours @property def milliseconds(self): - """milliseconds (int): milliseconds, 0 through 999.""" + """Milliseconds (int): milliseconds, 0 through 999.""" return self._milliseconds @property def minutes(self): - """minutes (int): minutes, 0 through 59.""" + """Minutes (int): minutes, 0 through 59.""" return self._minutes @property def month(self): - """month (int): month of year, 1 through 12.""" + """Month (int): month of year, 1 through 12.""" return self._month @property def seconds(self): - """seconds (int): seconds, 0 through 59.""" + """Seconds (int): seconds, 0 through 59.""" return self._seconds @property def year(self): - """year (int): year, 1601 through 30827.""" + """Year (int): year, 1601 through 30827.""" return self._year def _GetNormalizedTimestamp(self): diff --git a/pyproject.toml b/pyproject.toml index 9787c3b..51fbfa7 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"] +non-strict = false +wrap-summaries = 80 +wrap-descriptions = 80 diff --git a/setup.cfg b/setup.cfg index 172da2a..ca89d9e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dfdatetime -version = 20240113 +version = 20240128 description = Digital Forensics date and time (dfDateTime). long_description = dfDateTime, or Digital Forensics date and time, provides date and time objects to preserve accuracy and precision. long_description_content_type = text/plain diff --git a/tox.ini b/tox.ini index 2ca2a56..525766a 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,9 @@ commands = usedevelop = True deps = -rdocs/requirements.txt + docformatter commands = + docformatter --in-place --recursive dfdatetime sphinx-build -b html -d build/doctrees docs dist/docs sphinx-build -b linkcheck docs dist/docs @@ -45,7 +47,10 @@ setenv = deps = -rrequirements.txt -rtest_requirements.txt + docformatter pylint >= 2.17.0, < 2.18.0 commands = + docformatter --version pylint --version + docformatter --check --diff --recursive dfdatetime pylint --rcfile=.pylintrc dfdatetime setup.py tests