We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c4bc42 commit 83c2daeCopy full SHA for 83c2dae
tasks.py
@@ -0,0 +1,29 @@
1
+"""
2
+tasks.py
3
+--------
4
+Project invoke tasks
5
+
6
+Available commands
7
+ invoke --list
8
+ invoke fmt
9
+ invoke sort
10
11
+import invoke
12
13
+TARGETS_DESCRIPTION = "Paths/directories to format. [default: . ]"
14
15
16
+@invoke.task(help={"targets": TARGETS_DESCRIPTION})
17
+def sort(ctx, targets="."):
18
+ """Sort module imports."""
19
+ print("sorting imports ...")
20
+ args = ["isort", "-rc", "--atomic", targets]
21
+ ctx.run(" ".join(args))
22
23
24
+@invoke.task(pre=[sort], help={"targets": TARGETS_DESCRIPTION})
25
+def fmt(ctx, targets="."):
26
+ """Format python source code & sort imports."""
27
+ print("formatting ...")
28
+ args = ["black", targets]
29
0 commit comments