Skip to content

Commit

Permalink
multilineindent: fix issue with quoted values
Browse files Browse the repository at this point in the history
Closes #531

Signed-off-by: Konrad Weihmann <[email protected]>
  • Loading branch information
priv-kweihmann committed Mar 17, 2024
1 parent 86f80f0 commit 1585016
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oelint_adv/rule_base/rule_var_multilineindent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def __init__(self) -> None:
def __line_stats(self, raw: str, name: str, op: str) -> Tuple[int, List[str]]:
_map = {}

raw = raw.replace('\x1b"', '"')

first_line_determines_indent = False
# If the first line already has non-whitespace content, determine the alignment relative to the
# first quotation mark.
Expand Down
8 changes: 8 additions & 0 deletions tests/test_class_oelint_vars_multilineident.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ def test_bad_two(self, input_, id_, occurrence):
"
''',
},
{
'oelint_adv_test.bb':
'''
A = "\\
some \\"quoted\\" value \\
"
''',
},
],
)
def test_good(self, input_, id_, occurrence):
Expand Down

0 comments on commit 1585016

Please sign in to comment.