Hi Linaro Toolchain Group,
Is there any tool for checking coding style of the patches submitted to the Linaro Toolchain ? In other word is there any equivalent of Linux checkpatch.pl in Linaro Toolchain (GCC, Binutils etc) ? If yes, please let me know.
If not, then in general how people check the coding style of the patches they submit to Linaro Toolchain (GCC, Binutils etc). I assume manual inspection (line by line) may be very tedious thing to do.
Thanks.
On 03/06/15 16:39, Virendra Kumar Pathak wrote:
Hi Linaro Toolchain Group,
Is there any tool for checking coding style of the patches submitted to the Linaro Toolchain ? In other word is there any equivalent of Linux checkpatch.pl http://checkpatch.pl in Linaro Toolchain (GCC, Binutils etc) ? If yes, please let me know.
If not, then in general how people check the coding style of the patches they submit to Linaro Toolchain (GCC, Binutils etc). I assume manual inspection (line by line) may be very tedious thing to do.
Toolchain related patches go through the upstream review process first and gets committed there before being back-ported to Linaro branches. Therefore they follow the same coding standard requirement of the upstream project. You can refer to the upstream project's coding standard and associated scripts. For gcc, in the contrib directory there is a script called check_GNU_style.sh which can help to some extend.
Thanks, Kugan
On 06/03/2015 11:07 AM, Kugan wrote:
On 03/06/15 16:39, Virendra Kumar Pathak wrote:
Hi Linaro Toolchain Group,
Is there any tool for checking coding style of the patches submitted to the Linaro Toolchain ? In other word is there any equivalent of Linux checkpatch.pl http://checkpatch.pl in Linaro Toolchain (GCC, Binutils etc) ? If yes, please let me know.
If not, then in general how people check the coding style of the patches they submit to Linaro Toolchain (GCC, Binutils etc). I assume manual inspection (line by line) may be very tedious thing to do.
Toolchain related patches go through the upstream review process first and gets committed there before being back-ported to Linaro branches. Therefore they follow the same coding standard requirement of the upstream project. You can refer to the upstream project's coding standard and associated scripts. For gcc, in the contrib directory there is a script called check_GNU_style.sh which can help to some extend.
People have been pointing at clang-format recently but AFAIK support for GNU formatting (used in GCC and Binutils) is still infant.
-Y
On 3 June 2015 at 10:24, Yury Gribov y.gribov@samsung.com wrote:
People have been pointing at clang-format recently but AFAIK support for GNU formatting (used in GCC and Binutils) is still infant.
Patches welcome! :)
More seriously, we also recommend clang-format on all LLVM projects, though some formatting for specific sub-projects (ex. lld) is still lacking. There are those that prefer that way, so that we have a consistent formatting across all sub projects, but that's not realistic for GNU sub-projects.
cheers, --renato
On Jun 3, 2015, at 9:39 AM, Virendra Kumar Pathak kumarvir.pathak@gmail.com wrote:
Hi Linaro Toolchain Group,
Is there any tool for checking coding style of the patches submitted to the Linaro Toolchain ? In other word is there any equivalent of Linux checkpatch.pl in Linaro Toolchain (GCC, Binutils etc) ? If yes, please let me know.
If not, then in general how people check the coding style of the patches they submit to Linaro Toolchain (GCC, Binutils etc). I assume manual inspection (line by line) may be very tedious thing to do.
Linaro toolchain follows upstream toolchain projects coding style, which is GNU Coding Standard. There is no checker for it that I know of, but you can use "indent" to format your code according to the style, see [1].
Note, that in Linaro Toolchain, like in most Linaro projects, upstream comes first -- in our case this means that we only have patches in our toolchain that are committed or approved upstream. E.g., improvement committed to upstream trunk (gcc-6) is appropriate to be included into Linaro's gcc-5 branch; but a patch rejected for upstream trunk will not make it into Linaro's toolchain.
For the above reason you may need to consider submitting your changes directly to upstream toolchain projects. You can still CC us on such a submission and ask us to review it or help otherwise.
[1] http://stackoverflow.com/questions/411249/coding-style-checker-for-c
Thank you,
-- Maxim Kuvyrkov www.linaro.org
linaro-toolchain@lists.linaro.org