Skip to content

Commit

Permalink
style: fix 2 instances of lines that are too long (#2512)
Browse files Browse the repository at this point in the history
* Issue-2499: fix 2 instances of lines that are too long

* Issue-2499: Formatting expected output in yaml loader and adding normalize whitespace to pytest config
  • Loading branch information
rsk2 authored Oct 29, 2022
1 parent 66622cb commit 116e6c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def _convert_word(raw_word) -> Word:
)


# pylint: disable=line-too-long
def _convert_words(raw_words: List[Word]) -> List[Word]:
"""
Converts each YAML word definition into Word() objects
Expand All @@ -187,12 +186,16 @@ def _convert_words(raw_words: List[Word]) -> List[Word]:
... 'Also accepted': ['the female']
... }
... ])
[Word(in_target_language=["l'homme"], in_source_language=['the man'], pictures=['man1', 'man2', 'man3']), Word(in_target_language=['la femme', 'la dame'], in_source_language=['the woman', 'the female'], pictures=None)]
[Word(in_target_language=["l'homme"],
in_source_language=['the man'],
pictures=['man1', 'man2', 'man3']),
Word(in_target_language=['la femme', 'la dame'],
in_source_language=['the woman', 'the female'],
pictures=None)]
"""
return list(map(_convert_word, raw_words))


# pylint: disable=line-too-long
def _convert_phrase(raw_phrase) -> Phrase:
"""
Converts a YAML phrase definition into a Phrase() object
Expand All @@ -202,7 +205,8 @@ def _convert_phrase(raw_phrase) -> Phrase:
... 'Translation': 'The woman says hello',
... 'Alternative translations': ['The woman says hi']
... })
Phrase(in_target_language=['La femme dit bonjour', 'la femme dit salut'], in_source_language=['The woman says hello', 'The woman says hi'])
Phrase(in_target_language=['La femme dit bonjour', 'la femme dit salut'],
in_source_language=['The woman says hello', 'The woman says hi'])
"""
try:
return Phrase(
Expand Down
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[pytest]
norecursedirs = node_modules apps/web apps/docs apps/lluis apps/answer-corrector .*
doctest_optionflags = NORMALIZE_WHITESPACE

0 comments on commit 116e6c6

Please sign in to comment.