Skip to content

Commit 9881001

Browse files
committed
DOC: add DEVELOPMENT.md about doc for doclass attributes
1 parent 2a0169f commit 9881001

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

DEVELOPMENT.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,31 @@ instance as `dandi-api-local-docker-tests`. See the note below on the
4848
`DANDI_DEVEL` environment variable, which is needed in order to expose the
4949
development command line options.
5050

51+
## Code style conventions
52+
53+
### Dataclass and attrs field documentation
54+
55+
Document dataclass/attrs fields using `#:` comments above the field, not
56+
docstrings below. This is the format Sphinx autodoc recognizes for attribute
57+
documentation:
58+
59+
```python
60+
@dataclass
61+
class Movement:
62+
"""A movement/renaming of an asset"""
63+
64+
#: The asset's original path
65+
src: AssetPath
66+
#: The asset's destination path
67+
dest: AssetPath
68+
#: Whether to skip this operation because an asset already exists at the
69+
#: destination
70+
skip: bool = False
71+
```
72+
73+
See [dandi.move.Movement on RTD](https://dandi.readthedocs.io/en/latest/modref/generated/dandi.move.html#dandi.move.Movement)
74+
for a rendered example.
75+
5176
## Environment variables
5277

5378
- `DANDI_DEVEL` -- enables otherwise hidden command line options, such as

0 commit comments

Comments
 (0)