Skip to content

Commit

Permalink
--check-word: fail on missing template when run from the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Oct 22, 2023
1 parent ed156fb commit 3cb7e46
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wikidict/check_word.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Get and render a word; then compare with the rendering done on the Wiktionary to catch errors."""
import copy
import os
import re
from functools import partial
from threading import Lock
Expand All @@ -10,7 +11,7 @@
from bs4 import BeautifulSoup
from requests.exceptions import RequestException

from .render import parse_word
from .render import MISSING_TPL_SEEN, parse_word
from .stubs import Word
from .user_functions import color, int_to_roman
from .utils import get_random_word
Expand Down Expand Up @@ -385,4 +386,5 @@ def main(locale: str, word: str) -> int:
# If *word* is empty, get a random word
word = word or get_random_word(locale)

return check_word(word, locale)
res = check_word(word, locale)
return 1 if "CI" in os.environ and MISSING_TPL_SEEN else res

0 comments on commit 3cb7e46

Please sign in to comment.