Skip to content

Commit d2f2ee7

Browse files
authored
Fix Sphinx docs warnings (#116)
1 parent a315c88 commit d2f2ee7

File tree

12 files changed

+24
-15
lines changed

12 files changed

+24
-15
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/_data/** filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ dist/
66
*.pyc
77
__pycache__/
88
.pytest_cache/
9-
tests/docs/api
10-
tests/docs/build
9+
tests/_docs/api
10+
tests/_docs/build
1111
.tox/

dissect/cstruct/types/enum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ class Enum(BaseType, IntEnum, metaclass=EnumMetaType):
114114
Enums can be made using any integer type.
115115
116116
Example:
117-
When using the default C-style parser, the following syntax is supported:
117+
When using the default C-style parser, the following syntax is supported::
118118
119119
enum <name> [: <type>] {
120120
<values>
121121
};
122122
123-
For example, an enum that has A=1, B=5 and C=6 could be written like so:
123+
For example, an enum that has A=1, B=5 and C=6 could be written like so::
124124
125125
enum Test : uint16 {
126126
A, B=5, C

dissect/cstruct/types/flag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ class Flag(BaseType, IntFlag, metaclass=EnumMetaType):
1515
Flags can be made using any integer type.
1616
1717
Example:
18-
When using the default C-style parser, the following syntax is supported:
18+
When using the default C-style parser, the following syntax is supported::
1919
2020
flag <name> [: <type>] {
2121
<values>
2222
};
2323
24-
For example, a flag that has A=1, B=4 and C=8 could be written like so:
24+
For example, a flag that has A=1, B=4 and C=8 could be written like so::
2525
2626
flag Test : uint16 {
2727
A, B=4, C

tests/_data/testdef.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:46fab39cf8ed080513ea9e193ba08174f0133e133d249e60e5d819eb396ec7a7
3+
size 32

tests/docs/Makefile renamed to tests/_docs/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
6-
SPHINXOPTS ?= -jauto
6+
SPHINXOPTS ?= -jauto -w $(BUILDDIR)/warnings.log --fail-on-warning
77
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
99
BUILDDIR = build

tests/_docs/__init__.py

Whitespace-only changes.

tests/docs/conf.py renamed to tests/_docs/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
project = "dissect.cstruct"
2+
13
extensions = [
24
"autoapi.extension",
35
"sphinx.ext.autodoc",
@@ -32,3 +34,9 @@
3234
autodoc_member_order = "groupwise"
3335

3436
autosectionlabel_prefix_document = True
37+
38+
suppress_warnings = [
39+
# https://github.com/readthedocs/sphinx-autoapi/issues/285
40+
"autoapi.python_import_resolution",
41+
"ref.python",
42+
]
File renamed without changes.

tests/data/testdef.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)