mirror of
https://github.com/Casvt/MIND.git
synced 2026-02-19 11:54:46 -05:00
Added test command and improved type hint rule
This commit is contained in:
@@ -15,7 +15,10 @@ Once your request is accepted, you can start your local development.
|
||||
2. Make the changes needed and write accompanying tests.
|
||||
3. Check if the code written follows the styling guide below.
|
||||
4. Run the finished version, using python 3.7, to check if you've made any errors.
|
||||
5. Run the tests.
|
||||
5. Run the tests (unittest is used). This can be done with a button click within VS Code, or with the following command where you need to be inside the root folder of the project:
|
||||
```bash
|
||||
python3 -m unittest discover -v -s './tests' -p '*_test.py'
|
||||
```
|
||||
6. Test your version thoroughly to catch as many bugs as possible (if any).
|
||||
|
||||
## Styling guide
|
||||
@@ -23,7 +26,7 @@ The code of Noted is written in such way that it follows the following rules. Yo
|
||||
|
||||
1. Compatible with python 3.7 .
|
||||
2. Tabs (4 space size) are used for indentation.
|
||||
3. Type hints are used as much as possible, avoiding importing functions or classes from other files _just_ for the type hinting.
|
||||
3. Use type hints as much as possible, though don't if it requires importing extra functions or classes (except for the `typing` library).
|
||||
4. Each function in the backend needs a doc string describing the function, what the inputs are, what errors could be raised from within the function and what the output is.
|
||||
5. Each function in the `api.py` file should have a doc string describing the api endpoint. For the formatting, look at the doc strings of the other functions in the file.
|
||||
6. The imports need to be sorted (the extension `isort` is used in VS Code).
|
||||
|
||||
Reference in New Issue
Block a user