Skip to content

Commit

Permalink
fix doctree clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
bckohan committed Jun 2, 2024
1 parent 28122c3 commit 9f48691
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
27 changes: 11 additions & 16 deletions check.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
set -e # Exit immediately if a command exits with a non-zero status.

echox() {
echo "\033[34m$@\033[0m" # Manually echo the command
"$@" | while IFS= read -r line; do echo " \033[32m$line\033[0m"; done
}
set -e

if [ "$1" == "--no-fix" ]; then
echox poetry run ruff format --check
echox poetry run ruff check --select I
echox poetry run ruff check
poetry run ruff format --check
poetry run ruff check --select I
poetry run ruff check
else
echox poetry run ruff format
echox poetry run ruff check --fix --select I
echox poetry run ruff check --fix
poetry run ruff format
poetry run ruff check --fix --select I
poetry run ruff check --fix
fi

echox poetry check
echox poetry run pip check
poetry check
poetry run pip check
cd ./doc
echox poetry run doc8 --ignore-path build --max-line-length 100 -q
poetry run doc8 --ignore-path build --max-line-length 100 -q
set +e # Turn off the -e flag to allow the sphinx-build command to fail.
# check for broken links in the docs ############
echox poetry run sphinx-build -b linkcheck -q -D linkcheck_timeout=5 ./source ./build > /dev/null 2>&1
poetry run sphinx-build -b linkcheck -q -D linkcheck_timeout=5 ./source ./build > /dev/null 2>&1
if [ $? -ne 0 ]; then
cat ./build/output.txt
exit 1
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@
typer_get_web_driver = 'web_driver.typer_get_web_driver'

def setup(app):
if app.doctreedir.exists():
if Path(app.doctreedir).exists():
shutil.rmtree(app.doctreedir)
4 changes: 3 additions & 1 deletion doc/source/howto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ four things
def setup(app):
import shutil
if app.doctreedir.exists():
from pathlib import Path
if Path(app.doctreedir).exists():
shutil.rmtree(app.doctreedir)
Change the Width
----------------

Expand Down

0 comments on commit 9f48691

Please sign in to comment.