This PR makes the oelint.vars.multilineident check handle variables that are formatted according to the current Yocto style guide - see #515 for discussion.
In short: if a variable is formatted like this, the current state of the linter shows a warning because the alignment of the first line is determined to be 0:
FOO = "this line is \
long \
"
The new heuristic is: iff there is non-whitespace content in the first physical line of a multi-line assignment, a variable is assumed to be aligned after the ". If this is the case, that point will be used as the desired indentation instead of trying to determine a best-fit indentation.
All previous formats are still accepted and tests for this format are added.
Would you be willing to accept this change in behaviour?
I would classify it as a bugfix for the purpose of the PR checklist - but the "New feature" checklist is fulfilled as well.
Pull request checklist
Bugfix
[x] A testcase was added to test the behavior
New feature
[x] A testcase was added to test the behavior
[x] New functions are documented with docstrings
[x] No debug code is left
[x] README.md was updated to reflect the changes (check even if n.a.)
This PR makes the oelint.vars.multilineident check handle variables that are formatted according to the current Yocto style guide - see #515 for discussion. In short: if a variable is formatted like this, the current state of the linter shows a warning because the alignment of the first line is determined to be 0:
The new heuristic is: iff there is non-whitespace content in the first physical line of a multi-line assignment, a variable is assumed to be aligned after the
"
. If this is the case, that point will be used as the desired indentation instead of trying to determine a best-fit indentation.All previous formats are still accepted and tests for this format are added.
Would you be willing to accept this change in behaviour?
I would classify it as a bugfix for the purpose of the PR checklist - but the "New feature" checklist is fulfilled as well.
Pull request checklist
Bugfix
New feature