Skip to content

✅ Add interrogate #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ docker build . -t docker-python-base

case $1 in
run)
docker run -p 8000:8000 docker-python-base
docker run -p 8000:8000 docker-python-base $2
;;

validate)
Expand All @@ -19,4 +19,4 @@ case $1 in
*)
echo "Provide parameters 'run', 'validate', or 'cli' when calling e.g. ./dev.sh run"
;;
esac
esac
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ runtests() {
}


interrogateverbose() {
echo "Verify docstring coverage"
interrogate -vv
}


case "$1" in
startapp|developapp|validatecode|validatecodeonce|runtests)
startapp|developapp|validatecode|validatecodeonce|runtests|interrogateverbose)
# Run the identified command and the provided arguments
$@
;;
Expand Down
1 change: 1 addition & 0 deletions generate_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pip install \
flake8-quotes `# Plugin to enforce specific quotes convention, which PEP8 doesn't`\
flake8-print `# Plugin to prevent the use of print statements`\
black `# Formatting`\
interrogate `# Checks code base for missing docstrings`\


pip freeze > requirements.txt
4 changes: 4 additions & 0 deletions requirements_3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ asgiref==3.5.0
attrs==21.4.0
black==22.3.0
click==8.1.2
colorama==0.4.4
coverage==6.3.2
fastapi==0.75.1
flake8==4.0.1
Expand All @@ -13,6 +14,7 @@ flake8-quotes==3.3.1
h11==0.13.0
idna==3.3
iniconfig==1.1.1
interrogate==1.5.0
isort==5.10.1
loguru==0.6.0
mccabe==0.6.1
Expand All @@ -36,7 +38,9 @@ PyYAML==6.0
six==1.16.0
sniffio==1.2.0
starlette==0.17.1
tabulate==0.8.9
testfixtures==6.18.5
toml==0.10.2
tomli==2.0.1
typing_extensions==4.1.1
uvicorn==0.17.6
Expand Down
4 changes: 4 additions & 0 deletions requirements_3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ asgiref==3.5.0
attrs==21.4.0
black==22.3.0
click==8.1.2
colorama==0.4.4
coverage==6.3.2
fastapi==0.75.1
flake8==4.0.1
Expand All @@ -13,6 +14,7 @@ flake8-quotes==3.3.1
h11==0.13.0
idna==3.3
iniconfig==1.1.1
interrogate==1.5.0
isort==5.10.1
loguru==0.6.0
mccabe==0.6.1
Expand All @@ -36,7 +38,9 @@ PyYAML==6.0
six==1.16.0
sniffio==1.2.0
starlette==0.17.1
tabulate==0.8.9
testfixtures==6.18.5
toml==0.10.2
tomli==2.0.1
typing_extensions==4.1.1
uvicorn==0.17.6
Expand Down
4 changes: 4 additions & 0 deletions requirements_3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ asgiref==3.5.0
attrs==21.4.0
black==22.3.0
click==8.1.2
colorama==0.4.4
coverage==6.3.2
fastapi==0.75.1
flake8==4.0.1
Expand All @@ -13,6 +14,7 @@ flake8-quotes==3.3.1
h11==0.13.0
idna==3.3
iniconfig==1.1.1
interrogate==1.5.0
isort==5.10.1
loguru==0.6.0
mccabe==0.6.1
Expand All @@ -36,7 +38,9 @@ PyYAML==6.0
six==1.16.0
sniffio==1.2.0
starlette==0.17.1
tabulate==0.8.9
testfixtures==6.18.5
toml==0.10.2
tomli==2.0.1
typing_extensions==4.1.1
uvicorn==0.17.6
Expand Down
6 changes: 5 additions & 1 deletion test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ fi

echo

echo -ne "$SECTION_PREFIX CHECK DOCSTRINGS: "
INTERROGATEOUT=`interrogate`
reportvalidation "$INTERROGATEOUT"; STATUS5=$?

if [[ $1 == "reports" ]]
then
echo -ne "$SECTION_PREFIX Report files created in $REPORTS_FOLDER\n"
ls $REPORTS_FOLDER
echo
fi

TOTAL=$((STATUS1 + STATUS2 + STATUS3 + STATUS4 + STATUS5))
TOTAL=$((STATUS1 + STATUS2 + STATUS3 + STATUS4 + STATUS5 + STATUS6))
exit $TOTAL
12 changes: 12 additions & 0 deletions tests/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = true
ignore-semiprivate = true
ignore-private = true
ignore-property-decorators = true
ignore-module = true
ignore-nested-functions = true
ignore-nested-classes = true
ignore-setters = true
fail-under = 95
1 change: 1 addition & 0 deletions tests/webapp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

@app.get('/')
async def root():
"""A simple Hello World endpoint"""
return {'message': 'Hello World'}
1 change: 1 addition & 0 deletions tests/webapp/tests/simple_test.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
def test_something():
"""Just a test to have something for pytest to chew on"""
assert True