Coccinelle Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: wagi@monom.org (Daniel Wagner)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Formatting issues
Date: Tue, 30 Jul 2013 23:06:08 +0200	[thread overview]
Message-ID: <51F82AC0.1010508@monom.org> (raw)
In-Reply-To: <20130729155920.GA10905@domone.kolej.mff.cuni.cz>

On 07/29/2013 05:59 PM, Ond?ej B?lka wrote:
> On Mon, Jul 29, 2013 at 04:59:30PM +0200, Daniel Wagner wrote:
>> On 07/29/2013 11:28 AM, Ond?ej B?lka wrote:
>>> On Mon, Jul 29, 2013 at 11:07:35AM +0200, Daniel Wagner wrote:
>>>> On 07/29/2013 10:49 AM, Julia Lawall wrote:
>>>>> It's a simple rule in theory, but not so simple in practice.  Pretty
>>>>> printing is a hard problem, because doing a good job requires knowing both
>>>>> what you have seen before and what is coming up.  Also, when Coccinelle is
>>>>> generating code, it doesn't see the AST any more, only tokens, so it has
>>>>> limited information.
>>>>
>>>> I understand that in reality this is a hard problem. Something what
>>>> I would helpful here would be a list of lines (emacs/vim parseable)
>>>> where the the result line is too long, presumed that detecting of
>>>> long lines is easy.
>>>>
>>> I already did it in stylepp. You need to install it
>>
>> Thanks, I give it a try.
>>
> I now also wrote a similar tool,
>
> stylepp_restrict_formater
>
> It reverts changes on lines that were not touched in last commit so you
> could use following:
>
> apply patch,
> git commit
> for I in `git diff --name-only HEAD^`; do
>    run favourite formatter
> done
> stylepp_restrict_formatter

Thanks for the tipp. Since we are using pretty much the kernel codying 
style I just used checkpath.pl, that is

git diff | checkpatch.pl -

as compile command in emacs. Since emacs does not understand the 
error/warnings from checkpatch.pl (--emacs doesn't help because
the input file name is missing), I added a new compilation error regex 
rule to emacs. With that I can easly jump to the offendling lines and 
edit directly from emacs.

cheers,
daniel

  reply	other threads:[~2013-07-30 21:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 14:56 [Cocci] Formatting issues Daniel Wagner
2013-07-17 15:07 ` Julia Lawall
2013-07-17 15:16   ` Daniel Wagner
2013-07-17 15:31     ` Julia Lawall
2013-07-17 15:41       ` Daniel Wagner
2013-07-17 15:51       ` Ondřej Bílka
2013-07-29  8:42         ` Daniel Wagner
2013-07-29  8:49           ` Julia Lawall
2013-07-29  9:07             ` Daniel Wagner
2013-07-29  9:14               ` Julia Lawall
2013-07-29 14:58                 ` [Cocci] Formatting issue Daniel Wagner
2013-07-29  9:28               ` [Cocci] Formatting issues Ondřej Bílka
2013-07-29 14:59                 ` Daniel Wagner
2013-07-29 15:59                   ` Ondřej Bílka
2013-07-30 21:06                     ` Daniel Wagner [this message]
2013-07-28 10:48 ` Julia Lawall
2013-07-29  8:33   ` Daniel Wagner

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=51F82AC0.1010508@monom.org \
    --to=wagi@monom.org \
    --cc=cocci@systeme.lip6.fr \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox