Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2016 21:56:19 -0230
From:      "Jonathan Anderson" <jonathan@FreeBSD.org>
To:        "Bryan Drewery" <bdrewery@FreeBSD.org>
Cc:        "Pietro Cerutti" <gahr@FreeBSD.org>, "Matthew Seaman" <matthew@freebsd.org>, freebsd-hackers@freebsd.org, owner-freebsd-hackers@freebsd.org
Subject:   Re: Code Formatter for STYLE(9)?
Message-ID:  <98F4CDB7-FD74-494E-8D6A-8FBABE3FA982@FreeBSD.org>
In-Reply-To: <56F48322.9030208@FreeBSD.org>
References:  <56F3EBB1.1060603@embedded-brains.de> <56F3FFB3.6070801@FreeBSD.org> <1fc0f5efcc94822f7f5ca9bbcb850faf@gahr.ch> <56F48322.9030208@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 3156 and 4880).

--=_MailMate_9001ABCE-80DA-43A2-97EC-DFBFE29EA684_=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On 24 Mar 2016, at 21:45, Bryan Drewery wrote:

> On 3/24/2016 9:24 AM, Pietro Cerutti wrote:
>> On 2016-03-24 15:54, Matthew Seaman wrote:
>>> On 2016/03/24 13:29, Sebastian Huber wrote:
>>>> Hello,
>>>>
>>>> is there a ready to use C code formatter available that honours
>>>> STYLE(9)? I tried clang-format, but it knows only LLVM, Google,
>>>> Chromium, Mozilla by default. The GNU indent --original seems to pro=
duce
>>>> nothing usable. Same problem with astyle --style=3Dbsd.
>>>>
>>>
>>> pkg uses uncrustify with this config file:
>>>
>>> https://github.com/freebsd/pkg/blob/master/freebsd.cfg
>>>
>>> It's approximately what style(9) describes but doesn't cover things l=
ike
>>> sorting include files and I don't think it was updated in response to=

>>> the recent change allowing { brackets } around certain single-line
>>> statements.
>>
>> It looks like it does: https://github.com/freebsd/pkg/commit/1bc61a4
>>
>
> It's not quite right. It is adding {} to single-line if statements in
> some code.

Perhaps some of the `full_brace` cases should use `ignore` rather than `a=
dd` or `remove`, since the new rule is "you may put braces around single =
lines" rather than "you may not" (as in the old style(9)) or "you must" (=
as in this uncrustify config).


Jon
--
Jonathan Anderson
jonathan@FreeBSD.org
--=_MailMate_9001ABCE-80DA-43A2-97EC-DFBFE29EA684_=
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename=signature.asc
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQIcBAEBAgAGBQJW9IWrAAoJEDusuBaTfFXcWPwP/2JsfCNEZgQ2ROaWXoZcULgw
p4QD2/751AmzmgMCWFkmFFDMvLpGBHj92H1AilGHhv32TxqovOxbVEr0A9xzQBCt
IX2StMnppWuHrgfdcQNp1FfFvIYT3FYtBq+J0A8J6HipAgrXIx1/HUOjYIp8oq8j
J57hFiWkMzGa9Y7uhv/h7Y0JBS8/jV9xjoFIDp0P9eXwiS84cxl0uEuqWGn0VCgb
sPdS+E16RYOTlPCFVuFmmAfzQG3hSqVPXyp8uJlh256TolC+zfTZwAZEw4a1t7UT
+v424mFVp/NDvTDdgaJkPQcuWbr1BhFuk5R/oWkgQY6qyai0UPwLUxP8IAzn+Z+Y
G7BBD/6RLutbFqqiT6XFJRk0f85SD60pQrpiF4dULh7EGYLDjKqOVON6eJ3fkCbk
9Ic6RdDrvjuhdQ9RUK+qqCjudr3MjAbWpBWdZrjzf8VKrQCH+drgfHKgMuD/ap1i
XuCSdGcjn0qD5fjgnQNVnef9LpgcU+lpDGX73uqkyK+ocHUsjvzCPcR820vnWp+h
bT2cB/Tr3p+2YV6xZYKRywHgN20lmMmK9f6kiTJTQD84mATUzYJUPqPPKqF2VLH2
547K0SjrmfoyDHCr6cvPDtaqDxLFJhmXvpawfJIfNc8K4xaMLFogwse+Dclfgc0j
YvLQHPZZsdlnppcFuVKn
=Jkq2
-----END PGP SIGNATURE-----

--=_MailMate_9001ABCE-80DA-43A2-97EC-DFBFE29EA684_=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?98F4CDB7-FD74-494E-8D6A-8FBABE3FA982>