Skip to content

Commit 9e32fce

Browse files
committed
Add Type Checking section to CONTRIBUTING.rst
1 parent f3f2d03 commit 9e32fce

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

CONTRIBUTING.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,29 @@ This uses pytest_;
3535

3636
.. _known problem: http://www.mega-nerd.com/libsndfile/api.html#open_fd
3737

38+
Type Checking
39+
^^^^^^^^^^^^^
40+
41+
Type hints have been added to the codebase to support static type checking.
42+
You can use pyright to check the types:
43+
44+
.. code-block:: bash
45+
46+
pip install pyright
47+
pyright soundfile.py
48+
49+
Or you can use the VS Code extension for inline type checking.
50+
51+
When contributing, please maintain type hints for all public functions, methods, and classes.
52+
Make sure to use appropriate types from the typing and typing-extensions modules.
53+
54+
The following conventions are used:
55+
- Use Literal types for enumerated string values
56+
- Use TypeAlias for complex type definitions
57+
- Use overloads to provide precise return type information
58+
- Use Optional for parameters that can be None
59+
- Use Union for values that can be different types
60+
3861
Coverage
3962
^^^^^^^^
4063

0 commit comments

Comments
 (0)