summaryrefslogtreecommitdiff
path: root/tasks.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2022-07-14 12:59:16 -0400
committerGitHub <noreply@github.com>2022-07-14 12:59:16 -0400
commite95af81acb9c6829c969f76e40658356a4808edb (patch)
treeb728a33789c33cae913abb16b8d40ee2dd6ff7cf /tasks.py
parentf38194860572c32c4c1f475b16a901eb832d34e6 (diff)
downloadcmd2-git-e95af81acb9c6829c969f76e40658356a4808edb.tar.gz
Use latest version of mypy and fix type hinting accordingly (#1239)
* Use latest version of mypy and fix type hinting accordingly Also: - Update Pipfile to never require mock since we only support Python 3.6+ - Remove Azure Pipelines badge from Readme and fix section links there - Added an "inv format" task to run black and isort to auto-format all code before a commit * Try to fix type errors on versions prior to 3.8 * Restored correct types in argparse_custom.py
Diffstat (limited to 'tasks.py')
-rw-r--r--tasks.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tasks.py b/tasks.py
index 58bd1df8..a55661d8 100644
--- a/tasks.py
+++ b/tasks.py
@@ -353,3 +353,14 @@ def flake8(context):
namespace.add_task(flake8)
+
+
+# Black and isort auto-formatting
+@invoke.task()
+def format(context):
+ """Run black and isort auto-formatting for code style enforcement"""
+ with context.cd(TASK_ROOT_STR):
+ context.run("black . && isort .")
+
+
+namespace.add_task(format)