File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # docstringify
1+ # Docstringify
22Flag missing docstrings and, optionally, generate them from signatures and type annotations.
33
4+ ## About
5+
6+ Given a file, ` test.py ` , with the following contents:
7+
8+ ``` python
9+ def say_hello (name : str = ' World' ) -> None :
10+ print (f ' Hello, { name} ! ' )
11+ ```
12+
13+ You can use Docstringify in three modes:
14+
15+ 1 . Flag missing docstrings:
16+ ```
17+ test is missing a docstring
18+ test.say_hello is missing a docstring
19+ ```
20+ 2. Suggest docstring templates based on type annotations:
21+ ```
22+ test is missing a docstring
23+ Hint:
24+ """__description__"""
25+
26+ test.say_hello is missing a docstring
27+ Hint:
28+ """
29+ __description__
30+
31+ Parameters
32+ ----------
33+ name : str, default="World"
34+ __description__
35+ """
36+ ```
37+ 3. Add docstring templates to source code files:
38+ ```python
39+ """__description__"""
40+
41+ def say_hello(name: str = 'World') -> None:
42+ """
43+ __description__
44+
45+ Parameters
46+ ----------
47+ name : str, default="World"
48+ __description__
49+ """
50+ print(f'Hello, {name}!')
51+ ```
52+
453## Usage
554
655### Pre-commit hook
@@ -119,3 +168,7 @@ Docstring templates written to /.../test_docstringify.py
119168` ` `
120169
121170If you want to overwrite the file with the edits, pass `overwrite=True` to `DocstringTransformer()`.
171+
172+ # # Contributing
173+
174+ Please consult the [contributing guidelines](https://github.com/stefmolin/docstringify/blob/main/CONTRIBUTING.md).
You can’t perform that action at this time.
0 commit comments