diff --git a/README.md b/README.md index 0e1b95d..7168027 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,19 @@ https://fastapi.tiangolo.com/ python -m pip install --upgrade pip ``` +```bash +python -m pip install -r requirements-dev.txt +``` + ```bash python -m pip install -r requirements.txt ``` +## test / lint +```bash +pylint main.py +``` + ## run server ```bash uvicorn main:app --reload diff --git a/main.py b/main.py index 30d4a45..8c640fb 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,6 @@ +""" +This is the main file for the FastAPI tutorial +""" from typing import Union from fastapi import FastAPI @@ -7,9 +10,19 @@ @app.get("/") def read_root(): + """ + This is the root path + :return: + """ return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): + """ + This is the item path + :param item_id: + :param q: + :return: + """ return {"item_id": item_id, "q": q} diff --git a/qodana.yaml b/qodana.yaml index d54ae71..f7dcb25 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,2 +1,10 @@ version: "1.0" linter: jetbrains/qodana-python-community:2023.3 +#linter: jetbrains/qodana-python:2022.3-eap +bootstrap: | + rm -rf .idea + pip install -r requirements.txt --quiet +profile: + name: qodana.recommended +include: + - name: CheckDependencyLicenses diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..b1721e8 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +-r requirements.txt +pylint==3.0.3