New coding style for new files?

Joel Sherrill joel at rtems.org
Thu Sep 10 15:32:16 UTC 2020


On Thu, Sep 10, 2020 at 10:24 AM Gedare Bloom <gedare at rtems.org> wrote:

> On Mon, Sep 7, 2020 at 12:06 AM Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
> >
> > Hello,
> >
> > I think we waste too much time to address coding style issues on newly
> > contributed code, for example GSoC. I don't know a source code
> > formatting tool which supports the RTEMS coding style and I think it is
> > not worth the time to write and maintain such a tool specifically for
> > RTEMS. Why don't we simply allow an alternative coding style which has a
> > good code formatter for new source files? I don't propose to reformat
> > the existing files.
> >
> > I would simply pick up one of the standard styles supported by
> > clang-format and declare it as an acceptable coding style for RTEMS.
>

I am not willing to blanket accept another project's coding style.

I am willing to accept a configuration for a tool that is close to our
style and
make compromises on specific points.

I also think when doing this we should consider things that we do that
we have since learned safety standards don't like such as single statement
if's without braces. I think we should have braces now.

This is best viewed as an opportunity to improve but comes with changes
since I don't think any of us wants to add a few more configuration options
to any formatter. Although if we get close, I can see adding those as open
projects if someone is interested.


> > Then students can pipe their code through it before they send it for
> > review. This helps to concentrate on the important things to review and
> > not the white space.
> >
> This will work best in combination with a patch management/review
> system that can run the style checker and report which style it
> passes.
>
> For me, I definitely spend too much time pointing out style problems.
> Often I just do that before I will even think through the logic. But
> that is wasting a lot of time. I would be happy to see a path toward
> style-proved submissions.
>
> I know we discussed this topic a few times before. I think there was
> even a couple of close style matches found or suggested. I'm open to
> the discussion.
>
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200910/d69864f9/attachment.html>


More information about the devel mailing list