Spaces:
Running
Running
Added linting scripts
Browse files- setup.cfg +2 -2
- shell/format.sh +4 -0
- shell/lint.sh +23 -0
setup.cfg
CHANGED
|
@@ -4,11 +4,11 @@ description-file = README.md
|
|
| 4 |
[isort]
|
| 5 |
force_single_line=True
|
| 6 |
known_first_party=aeropath
|
| 7 |
-
line_length=
|
| 8 |
profile=black
|
| 9 |
|
| 10 |
[flake8]
|
| 11 |
# imported but unused in __init__.py, that's ok.
|
| 12 |
per-file-ignores=*__init__.py:F401
|
| 13 |
ignore=E203,W503,W605,F632,E266,E731,E712,E741
|
| 14 |
-
max-line-length=
|
|
|
|
| 4 |
[isort]
|
| 5 |
force_single_line=True
|
| 6 |
known_first_party=aeropath
|
| 7 |
+
line_length=160
|
| 8 |
profile=black
|
| 9 |
|
| 10 |
[flake8]
|
| 11 |
# imported but unused in __init__.py, that's ok.
|
| 12 |
per-file-ignores=*__init__.py:F401
|
| 13 |
ignore=E203,W503,W605,F632,E266,E731,E712,E741
|
| 14 |
+
max-line-length=160
|
shell/format.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
isort --sl demo/src/ demo/app.py
|
| 3 |
+
black --line-length 80 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 80 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!"
|