[hatari-devel] Coding style

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Regarding this commit:
commit 976e2238d24c413b76e2c2f0bb2937ee34dd5363
Author: Thomas Huth <huth@xxxxxxxxxxxxx>
Date:   Sat May 2 09:23:52 2020 +0200

    Fix coding style in statusbar.c

    statusbar.c is not derived from another
    project, so we should use the main Hatari
    coding style here and put curly braces on
    new lines.

It didn't fix anything.

Our coding style document:

try to adapt to the coding style of the file that
you're currently editing.

- For new files, pick one of the existing coding
  styles, don't add a new one.

That file had consistent style from the beginning,
similar to brace usage in several other Hatari
source files, other still actively maintained m68k
related projects [1], and other code I've been
recently involved with [2].

Because our main upstream projects are WinUAE,
Qemu and Aranym [3], and all of those use brace-
on-same-line style, I'm proposing that we adopt
that as the default style for rest of the Hatari
code too, for consistency's sake.

I would prefer using braces always (as Qemu does),
but WinAUE & Aranym often skip braces when they
aren't strictly needef, so I'm fine with both.

If agreed, I can convert src/debug/*.c files to
that convention as I'm nowadays doing most of
maintenance for that code, and several of the
files there already use brace-on-same-line style

Rest of the files could be converted later on, but
that needs input from Previous downstream project
in case it is still synching some code with

NOTE: I'm not proposing anything for other items
typically listed in coding style documents [4][5],
as I didn't find any consistency to things
documented in existing Hatari related projects.

	- Eero

[1] WinUAE, EmuTOS, Linux m68k [4], Qemu, Aranym [3]...

[2] I recently started learning Golang.  It has
    gofmt tool which enforces brace-on-same-line
    formatting for all code...

[3] Aranym has multiple styles like Hatari, for
some reason even in files that are copyrighted
by a single same person?

[4] as described here:

[5] Qemu uses brace-on-same-line, but different

Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/