From 65a3b4437831de07cbf7c65a2444d1b63d8e8982 Mon Sep 17 00:00:00 2001 From: Reed Swiernik Date: Wed, 23 Aug 2023 12:13:22 -0400 Subject: [PATCH] Add black and isort for python formatting --- tools/python/task.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tools/python/task.yaml b/tools/python/task.yaml index 0603480..dca673c 100644 --- a/tools/python/task.yaml +++ b/tools/python/task.yaml @@ -17,3 +17,25 @@ tasks: - task: os:install vars: VERSION: "{{.VERSION}}" + + venv: + desc: Install a python venv in the venv + deps: [pyenv] + cmds: + - python -m venv "{{.TASKFILE_DIR}}/venv" + + fmt:install: + desc: Install isort and black + deps: [pyenv, venv] + cmds: + - pip install black + - pip install isort + + fmt: + desc: Format python code. + deps: [fmt:install] + cmds: + - source venv/bin/activate && + isort *.py scripts core_services + - source venv/bin/activate && + black -l 120 *.py scripts core_services