Skip to content

Commit

Permalink
Fix Sphinx rst warnings (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
JSCU-CNI authored Feb 17, 2025
1 parent ba83985 commit 380ff1c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions flow/record/adapter/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@


class DefaultMissing(dict):
"""A dictionary subclass that returns a formatted string for missing keys.
Example:
>>> d = DefaultMissing({"foo": "bar"})
>>> d['foo']
'bar'
>>> d['missing_key']
'{missing_key}'
"""

def __missing__(self, key: str) -> str:
return key.join("{}")

Expand Down
2 changes: 1 addition & 1 deletion tests/docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -jauto
SPHINXOPTS ?= -jauto -w $(BUILDDIR)/warnings.log --fail-on-warning
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build
Expand Down
5 changes: 5 additions & 0 deletions tests/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@
autodoc_member_order = "groupwise"

autosectionlabel_prefix_document = True

suppress_warnings = [
# https://github.com/readthedocs/sphinx-autoapi/issues/285
"autoapi.python_import_resolution",
]

0 comments on commit 380ff1c

Please sign in to comment.