Contributing to examples/src
Air has a system for ensuring that its code examples:
- Can be run as working Air apps
- Have tests that are run in CI and pass
To add a code example:
-
Create a sample Air app file with the naming pattern:
-
module__example.pywhereexampleis a function, or module__ClassName.pywhereClassNameis a class-
module__ClassName__method_name.pywhereClassNameis a class andmethod_nameis one of its methods -
Create a test file with the same name +
__test.py: -
If the Air app file is
module__example.py, the test ismodule__example__test.py -
In that test file, write tests for it, following the patterns of the other modules in there