generated from rochacbruno/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2f7f6f
commit 5e62bdf
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# Check if file argument was provided | ||
if [ $# -eq 0 ]; then | ||
echo "Error: no file provided" | ||
exit 1 | ||
fi | ||
|
||
# Get filename from first argument | ||
file=$1 | ||
|
||
# Format file with yapf | ||
echo "Formatting $file with yapf" | ||
python -m yapf -i "$file" | ||
|
||
# Type check qtsit package | ||
echo "Type checking deepchem package with mypy" | ||
python -m mypy -p qtsit | ||
|
||
# Lint file with flake8 and show count | ||
echo "Linting $file with flake8" | ||
python -m flake8 "$file" --count | ||
|
||
# Check if filename contains "test" | ||
if [[ $file != *"test"* ]]; then | ||
# Test file with doctest | ||
echo "Testing $file with doctest" | ||
python -m doctest "$file" | ||
else | ||
echo "Skipping doctest for test file $file" | ||
echo "running pytest on $file" | ||
python -m pytest "$file" | ||
fi | ||
~ |