All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Add astyle option file for code formatting
Date: Fri, 16 Sep 2011 16:31:18 +0200	[thread overview]
Message-ID: <4E735DB6.1030209@mail.berlios.de> (raw)
In-Reply-To: <4E734A0D.3010309@codemonkey.ws>

Am 16.09.2011 15:07, schrieb Anthony Liguori:
> On 09/11/2011 12:00 PM, Stefan Weil wrote:
>> For new C code (and maybe also for existing code), a code formatter
>> like Artistic Style is helpful because it can fix tabs, indentation
>> and other style issues.
>>
>> This option file tries to set astyle options which match QEMU's
>> coding conventions.
>>
>> The quality of astyle's code formatting depends on the astyle version
>> (I got best results with newer versions) and on the code which is going
>> to be formatted.
>>
>> For some code, formatting of brackets and operators does not work well.
>> Fixing indentation and tabs always worked well for me.
>>
>> Signed-off-by: Stefan Weil<weil@mail.berlios.de>
>> ---
>>   scripts/astylerc |   16 ++++++++++++++++
>>   1 files changed, 16 insertions(+), 0 deletions(-)
>>   create mode 100644 scripts/astylerc
>>
> Please put a copyright in this file.
>
> FWIW, this is what I use with emacs:
>
> (c-add-style "qemu"
>         '("stroustrup"
>                 (indent-tabs-mode . nil)
>                 (c-basic-offset   . 4)
>                 (tab-width . 8)
>         )
>         nil) ; t = set this style, nil = don't
>
> Regards,
>
> Anthony Liguori

Are you sure that you want a copyright even for simple configuration
files like this one? I don't think this file could be copyrighted in
my country because it is too simple.

There are more complex files in scripts without any copyright:

scripts/create_config
scripts/hxtool
scripts/make_device_config.sh
scripts/qemu-binfmt-conf.sh

If it is common understanding that every file should have a copyright,
this rule should be added to CODING_STYLE.

I don't mind adding a line "# public domain", nor do I mind if it
is committed as it is.

Regards,
Stefan Weil

PS. It might help some people if you would commit your emacs style, too.

  reply	other threads:[~2011-09-16 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11 17:00 [Qemu-devel] [PATCH] Add astyle option file for code formatting Stefan Weil
2011-09-16 13:07 ` Anthony Liguori
2011-09-16 14:31   ` Stefan Weil [this message]
2011-09-19  8:01   ` Markus Armbruster
2011-09-19  8:38     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E735DB6.1030209@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.