From 11cb8813c044be9a470bdf36820738887798ecde Mon Sep 17 00:00:00 2001 From: leccelecce <24962424+leccelecce@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:09:27 +0000 Subject: [PATCH] Update dev contrib docs with Python checks --- docs/docs/development/contributing.md | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/docs/development/contributing.md b/docs/docs/development/contributing.md index a123f70b8..bb6b90eac 100644 --- a/docs/docs/development/contributing.md +++ b/docs/docs/development/contributing.md @@ -89,6 +89,14 @@ After closing VS Code, you may still have containers running. To close everythin ### Testing +#### Unit Tests + +GitHub will execute unit tests on new PRs. You must ensure that all tests pass. + +```shell +python3 -u -m unittest +``` + #### FFMPEG Hardware Acceleration The following commands are used inside the container to ensure hardware acceleration is working properly. @@ -125,6 +133,28 @@ ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format ffmpeg -c:v h264_qsv -re -stream_loop -1 -i https://streams.videolan.org/ffmpeg/incoming/720p60.mp4 -f rawvideo -pix_fmt yuv420p pipe: > /dev/null ``` +### Submitting a pull request + +Code must be formatted, linted and type-tested. GitHub will run these checks on pull requests, so it is advised to run them yourself prior to opening. + +**Formatting** + +```shell +ruff format frigate migrations docker *.py +``` + +**Linting** + +```shell +ruff check frigate migrations docker *.py +``` + +**MyPy Static Typing** + +```shell +python3 -u -m mypy --config-file frigate/mypy.ini frigate +``` + ## Web Interface ### Prerequisites