Hi Tamas,
The guidelines look good.
I would suggest distinguishing these rules between `original tfm created sources` and `3rd party` sources because tfm is now involving some 3rd party projects and we should keep their original taste as much as we could.
/Ken
-----Original Message----- From: TF-M tf-m-bounces@lists.trustedfirmware.org On Behalf Of Kumar Gala via TF-M Sent: Tuesday, November 19, 2019 11:22 PM To: Kevin Townsend kevin.townsend@linaro.org Cc: tf-m@lists.trustedfirmware.org Subject: Re: [TF-M] Coding guideline
I’ve been curious if something like https://lgtm.com/ could be used to have checks for code guidelines.
- k
On Nov 19, 2019, at 8:22 AM, Kevin Townsend via TF-M tf-m@lists.trustedfirmware.org wrote:
Hi Tamas,
Just to add to the conversation, something that the Zephyr project added to make enforcing the coding guidelines easier was a config file for uncrustify.
https://docs.zephyrproject.org/latest/contribute/index.html#uncrustify
The Zephyr config file itself can be seen here: https://github.com/zephyrproject-rtos/zephyr/blob/master/.uncrustify.c fg
The advantage here is that most text editors can be configured to automatically apply these rules and avoid common white space or other issues.
I've generally found this very useful generating PRs and just ensuring I didn't make any obvious errors when I commit files or changes.
Best regards, Kevin
On Mon, 18 Nov 2019 at 17:31, Tamas Ban via TF-M tf-m@lists.trustedfirmware.org wrote:
Hi,
I would like to open a conversation about TF-M coding guidelinehttps://git.trustedfirmware.org/trusted-firmware-m.git/tree/docs/coding_guide.rst. I have these proposals:
- Change the rule of the 80 character column width:
- Max 80 characters length.
- Column length is max 80 character in first place, but there are exceptions when length could be MAX 120 character:
- Degrades code understandability: short, obscured variable names; awkward line breaks
- Maximum 1% of the lines can exceed 80 charter length.
- Might remove this rule, because in many cases we are not complaint with it. For example PSA Crypto API:
o Order function parameters so that input params are before output params.
o https://git.trustedfirmware.org/trusted-firmware-m.git/tree/interface/includ...
I'm interested in your opinions! Other rules also can be revisited!
Tamas
TF-M mailing list TF-M@lists.trustedfirmware.org https://lists.trustedfirmware.org/mailman/listinfo/tf-m
-- TF-M mailing list TF-M@lists.trustedfirmware.org https://lists.trustedfirmware.org/mailman/listinfo/tf-m
-- TF-M mailing list TF-M@lists.trustedfirmware.org https://lists.trustedfirmware.org/mailman/listinfo/tf-m
tf-m@lists.trustedfirmware.org