Skip to content

Commit d90bbdb

Browse files
authored
Changes to use docformatter (#61)
1 parent d173231 commit d90bbdb

11 files changed

+42
-23
lines changed

acstore/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
to read and write plaso storage files.
66
"""
77

8-
__version__ = '20240121'
8+
__version__ = '20240128'

acstore/containers/interface.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ def CopyToString(self):
4949
class AttributeContainer(object):
5050
"""The attribute container interface.
5151
52-
This is the base class for those object that exists primarily as
53-
a container of attributes with basic accessors and mutators.
52+
This is the base class for those object that exists primarily as a container
53+
of attributes with basic accessors and mutators.
5454
55-
The CONTAINER_TYPE class attribute contains a string that identifies
56-
the container type, for example the container type "event" identifiers
57-
an event object.
55+
The CONTAINER_TYPE class attribute contains a string that identifies the
56+
container type, for example the container type "event" identifiers an event
57+
object.
5858
5959
Attributes are public class members of a serializable type. Protected and
6060
private class members are not to be serialized, with the exception of those

acstore/fake_store.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def __init__(self):
2222
def _RaiseIfNotReadable(self):
2323
"""Raises if the store is not readable.
2424
25-
Raises:
26-
OSError: if the store cannot be read from.
27-
IOError: if the store cannot be read from.
25+
Raises:
26+
OSError: if the store cannot be read from.
27+
IOError: if the store cannot be read from.
2828
"""
2929
if not self._is_open:
3030
raise IOError('Unable to read from closed storage writer.')

acstore/interface.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ def _GetAttributeContainerSchema(self, container_type):
8282
def _RaiseIfNotReadable(self):
8383
"""Raises if the store is not readable.
8484
85-
Raises:
86-
OSError: if the store cannot be read from.
87-
IOError: if the store cannot be read from.
85+
Raises:
86+
OSError: if the store cannot be read from.
87+
IOError: if the store cannot be read from.
8888
"""
8989

9090
@abc.abstractmethod
9191
def _RaiseIfNotWritable(self):
9292
"""Raises if the store is not writable.
9393
94-
Raises:
95-
OSError: if the store cannot be written to.
96-
IOError: if the store cannot be written to.
94+
Raises:
95+
OSError: if the store cannot be written to.
96+
IOError: if the store cannot be written to.
9797
"""
9898

9999
def _SetAttributeContainerNextSequenceNumber(

acstore/sqlite_store.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,9 @@ def _HasTable(self, table_name):
563563
def _RaiseIfNotReadable(self):
564564
"""Raises if the attribute container store is not readable.
565565
566-
Raises:
567-
IOError: when the attribute container store is closed.
568-
OSError: when the attribute container store is closed.
566+
Raises:
567+
IOError: when the attribute container store is closed.
568+
OSError: when the attribute container store is closed.
569569
"""
570570
if not self._is_open:
571571
raise IOError('Unable to read from closed attribute container store.')

config/dpkg/changelog

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
acstore (20240121-1) unstable; urgency=low
1+
acstore (20240128-1) unstable; urgency=low
22

33
* Auto-generated
44

5-
-- Log2Timeline maintainers <log2timeline-maintainers@googlegroups.com> Sun, 21 Jan 2024 08:55:35 +0100
5+
-- Log2Timeline maintainers <log2timeline-maintainers@googlegroups.com> Sun, 28 Jan 2024 14:31:51 +0100

docs/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
# docstrings.
5353
napoleon_google_docstring = True
5454
napoleon_numpy_docstring = False
55+
napoleon_include_init_with_doc = True
5556
napoleon_include_private_with_doc = False
5657
napoleon_include_special_with_doc = True
5758

pyproject.toml

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
[build-system]
22
requires = ["setuptools", "wheel"]
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.docformatter]
6+
black = false
7+
non-cap = ["dfDateTime", "dfImageTools", "dfVFS", "dfWinReg", "dtFabric"]
8+
non-strict = false
9+
wrap-summaries = 80
10+
wrap-descriptions = 80

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = acstore
3-
version = 20240121
3+
version = 20240128
44
description = Attribute Container Storage (ACStore).
55
long_description = ACStore, or Attribute Container Storage, provides a stand-alone implementation to read and write attribute container storage files.
66
long_description_content_type = text/plain

tox.ini

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py3{7,8,9,10,11,12},coverage,docs,lint,wheel
2+
envlist = py3{7,8,9,10,11,12},coverage,docformatter,docs,lint,wheel
33

44
[testenv]
55
allowlist_externals = ./run_tests.py
@@ -25,6 +25,13 @@ commands =
2525
coverage: coverage xml
2626
wheel: python -m build --no-isolation --wheel
2727

28+
[testenv:docformatter]
29+
usedevelop = True
30+
deps =
31+
docformatter
32+
commands =
33+
docformatter --in-place --recursive acstore tests
34+
2835
[testenv:docs]
2936
usedevelop = True
3037
deps =
@@ -45,10 +52,14 @@ setenv =
4552
deps =
4653
-rrequirements.txt
4754
-rtest_requirements.txt
55+
docformatter
4856
pylint >= 3.0.0, < 3.1.0
57+
setuptools
4958
yamllint >= 1.26.0
5059
commands =
60+
docformatter --version
5161
pylint --version
5262
yamllint -v
63+
docformatter --check --diff --recursive acstore setup.py tests
5364
pylint --rcfile=.pylintrc acstore setup.py tests
5465
yamllint -c .yamllint.yaml test_data

utils/update_release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ acstore (${VERSION}-1) unstable; urgency=low
2525
EOT
2626

2727
# Regenerate the API documentation.
28-
tox -edocs
28+
tox -edocformatter,docs
2929

3030
exit ${EXIT_SUCCESS};
3131

0 commit comments

Comments
 (0)