Skip to content

Commit

Permalink
Added linting scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
andreped authored Oct 4, 2023
1 parent 9dd395f commit 87f4ea6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ description-file = README.md
[isort]
force_single_line=True
known_first_party=aeropath
line_length=80
line_length=160
profile=black

[flake8]
# imported but unused in __init__.py, that's ok.
per-file-ignores=*__init__.py:F401
ignore=E203,W503,W605,F632,E266,E731,E712,E741
max-line-length=80
max-line-length=160
4 changes: 4 additions & 0 deletions shell/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
isort --sl demo/src/ demo/app.py
black --line-length 80 demo/src/ demo/app.py
flake8 demo/src/ demo/app.py
23 changes: 23 additions & 0 deletions shell/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
isort --check --sl -c demo/src/ demo/app.py
if ! [ $? -eq 0 ]
then
echo "Please run \"sh shell/format.sh\" to format the code."
exit 1
fi
echo "no issues with isort"
flake8 demo/src/ demo/app.py
if ! [ $? -eq 0 ]
then
echo "Please fix the code style issue."
exit 1
fi
echo "no issues with flake8"
black --check --line-length 80 demo/src/ demo/app.py
if ! [ $? -eq 0 ]
then
echo "Please run \"sh shell/format.sh\" to format the code."
exit 1
fi
echo "no issues with black"
echo "linting success!"

0 comments on commit 87f4ea6

Please sign in to comment.