priv-kweihmann / oelint-adv

Advanced oelint
BSD 2-Clause "Simplified" License
54 stars 27 forks source link

multilineident: Accept indentation based on non-empty first lines #517

Closed amuetzel closed 6 months ago

amuetzel commented 6 months ago

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

New feature