Added shell scripts
Browse files- shell/format.sh +4 -0
- shell/lint.sh +23 -0
shell/format.sh
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
isort --sl demo/src/ demo/app.py
|
3 |
+
black --line-length 160 demo/src/ demo/app.py
|
4 |
+
flake8 demo/src/ demo/app.py
|
shell/lint.sh
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
isort --check --sl -c demo/src/ demo/app.py
|
3 |
+
if ! [ $? -eq 0 ]
|
4 |
+
then
|
5 |
+
echo "Please run \"sh shell/format.sh\" to format the code."
|
6 |
+
exit 1
|
7 |
+
fi
|
8 |
+
echo "no issues with isort"
|
9 |
+
flake8 demo/src/ demo/app.py
|
10 |
+
if ! [ $? -eq 0 ]
|
11 |
+
then
|
12 |
+
echo "Please fix the code style issue."
|
13 |
+
exit 1
|
14 |
+
fi
|
15 |
+
echo "no issues with flake8"
|
16 |
+
black --check --line-length 160 demo/src/ demo/app.py
|
17 |
+
if ! [ $? -eq 0 ]
|
18 |
+
then
|
19 |
+
echo "Please run \"sh shell/format.sh\" to format the code."
|
20 |
+
exit 1
|
21 |
+
fi
|
22 |
+
echo "no issues with black"
|
23 |
+
echo "linting success!"
|