Skip to content

Commit e2d81d2

Browse files
authored
Improvements on copilot instructions for python docstrings (microsoft#977)
# Pull Request ## Title Improvements on copilot instructions for python docstrings ______________________________________________________________________ ## Description Make sure we use numpydoc format. Improvements on microsoft#972 ______________________________________________________________________ ## Type of Change - 🛠️ Bug fix - 📝 Documentation update ______________________________________________________________________ ## Testing Local VSCode. ______________________________________________________________________
1 parent c82d1f9 commit e2d81d2

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/instructions/python.instructions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ applyTo: '**/*.py'
88

99
- All functions, methods, classes, and attributes should have docstrings.
1010

11+
- Docstrings should be formatted using the [NumPy style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html) format.
12+
13+
- The docstring should include a summary of the function or method's purpose, followed by a description of its parameters and return values.
14+
15+
- The docstring should also include any exceptions that may be raised by the function or method.
16+
17+
- Where possible docstring should include an executable example of how to use the function or method, including any important details about its usage.
18+
1119
- Docstrings should include Sphinx style crossref directives for functions, methods, classes, attributes, and data whenever possible using `:py:class:` or `:py:func:` or `:py:meth:` or `:py:attr:` or `:py:data` syntax, respectively,
1220

1321
See Also <https://www.sphinx-doc.org/en/master/usage/domains/python.html#python-xref-roles>

0 commit comments

Comments
 (0)