Skip to content

Commit 42e7851

Browse files
committed
better docstring
1 parent fd5d8a4 commit 42e7851

File tree

2 files changed

+49
-2
lines changed

2 files changed

+49
-2
lines changed

adafruit_json_stream.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,15 @@ def read(self):
4141
return char
4242

4343
def fast_forward(self, closer, *, return_object=False):
44-
"""Read through the stream until the character is ``closer``, ``]``
44+
"""
45+
Read through the stream until the character is ``closer``, ``]``
4546
(ending a list) or ``}`` (ending an object.) Intermediate lists and
46-
objects are skipped."""
47+
objects are skipped.
48+
49+
:param str closer: the character to read until
50+
:param bool return_object: read until the closer,
51+
and then parse the data and return as an object
52+
"""
4753

4854
closer = ord(closer)
4955
close_stack = [closer]

tox.ini

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-FileCopyrightText: 2022 Kevin Conley
2+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
3+
#
4+
# SPDX-License-Identifier: MIT
5+
6+
[tox]
7+
envlist = py311
8+
9+
[testenv]
10+
description = run tests
11+
deps =
12+
pytest==7.4.3
13+
requests
14+
commands = pytest
15+
16+
[testenv:coverage]
17+
description = run coverage
18+
deps =
19+
pytest==7.4.3
20+
pytest-cov==4.1.0
21+
requests
22+
package = editable
23+
commands =
24+
coverage run --source=. --omit=tests/* --branch {posargs} -m pytest
25+
coverage report
26+
coverage html
27+
28+
[testenv:lint]
29+
description = run linters
30+
deps =
31+
pre-commit==3.6.0
32+
skip_install = true
33+
commands = pre-commit run {posargs}
34+
35+
[testenv:docs]
36+
description = build docs
37+
deps =
38+
-r requirements.txt
39+
-r docs/requirements.txt
40+
skip_install = true
41+
commands = sphinx-build -E -W -b html docs/. _build/html

0 commit comments

Comments
 (0)