From 116e6c697a44bc32782c6764e3efb6b3e697791d Mon Sep 17 00:00:00 2001 From: rsk2 Date: Sat, 29 Oct 2022 13:06:47 +0530 Subject: [PATCH] style: fix 2 instances of lines that are too long (#2512) * 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 --- .../librelingo_yaml_loader/yaml_loader.py | 12 ++++++++---- pytest.ini | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/librelingo_yaml_loader/librelingo_yaml_loader/yaml_loader.py b/apps/librelingo_yaml_loader/librelingo_yaml_loader/yaml_loader.py index 9d190118e24b..c3d5484e2e3e 100644 --- a/apps/librelingo_yaml_loader/librelingo_yaml_loader/yaml_loader.py +++ b/apps/librelingo_yaml_loader/librelingo_yaml_loader/yaml_loader.py @@ -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 @@ -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 @@ -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( diff --git a/pytest.ini b/pytest.ini index f466ab8bcdc4..4011e545e0f0 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,3 @@ [pytest] norecursedirs = node_modules apps/web apps/docs apps/lluis apps/answer-corrector .* +doctest_optionflags = NORMALIZE_WHITESPACE