Skip to content

Commit

Permalink
Added shell scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
andreped committed Nov 9, 2023
1 parent ddc22b2 commit 599b55b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
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 160 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 160 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 599b55b

Please sign in to comment.