On Thu, Mar 24, 2022 at 08:47:12PM -0500, Andrew F. Davis via
lists.yoctoproject.org wrote:
> On 3/24/22 5:21 PM, Ryan Eatmon via lists.yoctoproject.org wrote:
> >@@ -167,6 +182,10 @@ ALTERNATIVE_${PN}_am64xx = "\
> > am64-main-r5f1_1-fw \
> > am64-mcu-m4f0_0-fw \
> > "
> >+ALTERNATIVE_${PN}_am62xx = "\
> >+ am62-mcu-m4f0_0-fw \
> >+ am62-main-r5f0_0-fw \
>
>
> ^^ Looks like some tabs found there way in here..
>
> Why do we have these indented so far anyway, this whole file has wacky
> indenting, needs normalized.
Some quotes from the manual for 3 different cases - shell code, python code
and multi-line statements:
===============================================
Indentation: Use spaces for indentation rather than than tabs. For shell
functions, both currently work. However, it is a policy decision of the Yocto
Project to use tabs in shell functions. Realize that some layers have a policy
to use spaces for all indentation.
Python Function Whitespace: All Python functions must now use four spaces for
indentation. Previously, an inconsistent mix of spaces and tabs existed, which
made extending these functions using _append or _prepend complicated given
that Python treats whitespace as syntactically significant. If you are
defining or extending any Python functions (e.g. populate_packages, do_unpack,
do_patch and so forth) in custom recipes or classes, you need to ensure you
are using consistent four-space indentation.
Line Continuation: \ - Use the backward slash (\) character to split a
statement over multiple lines. Place the slash character at the end of the
line that is to be continued on the next line:
VAR = "A really long \
line"
===============================================
As you can see in the final example of multi-line, it shows the second line
starting where its content begins in the previous line. But it is not required
to indent like that, especially if the left part before the assignment sign is
very long, e.g.:
ALTERNATIVE_${PN}_am62xx = "am62-mcu-m4f0_0-fw \
am62-main-r5f0_0-fw \
Instead, you could start at the beginning of the line or use minimal
indentation of few spaces (no tabs here):
ALTERNATIVE_${PN}_am62xx = " \
am62-mcu-m4f0_0-fw \
am62-main-r5f0_0-fw \
ALTERNATIVE_${PN}_am62xx = " \
am62-mcu-m4f0_0-fw \
am62-main-r5f0_0-fw \
Both are acceptable.
Tabs to be only used in shell functions, such as do_compile, do_install, etc.
And one more final comment - when making functional changes, please keep the
existing indentation as is. If indentation need to be cleaned up or changed
for a recipe, should be a separate patch just for that w/o any functionality
or code changes - don't mix them in a single patch, unless it's a one-off.
--
Regards,
Denys Dmytriyenko <[email protected]>
PGP: 0x420902729A92C964 - https://denix.org/0x420902729A92C964
Fingerprint: 25FC E4A5 8A72 2F69 1186 6D76 4209 0272 9A92 C964
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#14555):
https://lists.yoctoproject.org/g/meta-ti/message/14555
Mute This Topic: https://lists.yoctoproject.org/mt/90010764/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-