cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] Checking the handling of spaces before opening parentheses for source code transformations
@ 2020-11-05 15:06 Markus Elfring
  2020-11-05 15:49 ` Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2020-11-05 15:06 UTC (permalink / raw)
  To: Coccinelle

Hello,

The coding style specification for C programs in GNOME contains also
the following information.
https://developer.gnome.org/programming-guidelines/stable/c-coding-style.html.en#whitespace

“…
Always put a space before an opening parenthesis but never after:
…”


How good can the semantic patch language support such a requirement
(also for function declarations and corresponding calls) directly?

See also a related feature request once more:
Make change influence configurable for coding style rules
https://github.com/coccinelle/coccinelle/issues/37

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] Checking the handling of spaces before opening parentheses for source code transformations
  2020-11-05 15:06 [Cocci] Checking the handling of spaces before opening parentheses for source code transformations Markus Elfring
@ 2020-11-05 15:49 ` Julia Lawall
  2020-11-05 16:32   ` Markus Elfring
  2020-11-05 17:28   ` Markus Elfring
  0 siblings, 2 replies; 4+ messages in thread
From: Julia Lawall @ 2020-11-05 15:49 UTC (permalink / raw)
  To: Markus Elfring; +Cc: Coccinelle

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]



On Thu, 5 Nov 2020, Markus Elfring wrote:

> Hello,
>
> The coding style specification for C programs in GNOME contains also
> the following information.
> https://developer.gnome.org/programming-guidelines/stable/c-coding-style.html.en#whitespace
>
> “…
> Always put a space before an opening parenthesis but never after:
> …”
>
>
> How good can the semantic patch language support such a requirement
> (also for function declarations and corresponding calls) directly?
>
> See also a related feature request once more:
> Make change influence configurable for coding style rules
> https://github.com/coccinelle/coccinelle/issues/37

If you want to check for such properties, you can use position variables.
If you want to ensure that your generated code has such properties, you
can use the argument --smpl-spacing.  If you want something more, you are
welcome to implement it.  We only focus on the coding style of the Linux
kernel.

julia

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] Checking the handling of spaces before opening parentheses for source code transformations
  2020-11-05 15:49 ` Julia Lawall
@ 2020-11-05 16:32   ` Markus Elfring
  2020-11-05 17:28   ` Markus Elfring
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2020-11-05 16:32 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Coccinelle

> If you want to ensure that your generated code has such properties,
> you can use the argument --smpl-spacing.

It is nice that code additions can be influenced by such a parameter.


> If you want something more, you are welcome to implement it.

I imagine that adjustments for matched metavariables might need
further development considerations.
Would there be a need to reformat any expression code (for example)?

Which software places would become interesting for extensions of
source code layout algorithms?


> We only focus on the coding style of the Linux kernel.

How are the chances that interests will grow also for source files
of GNOME components?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Cocci] Checking the handling of spaces before opening parentheses for source code transformations
  2020-11-05 15:49 ` Julia Lawall
  2020-11-05 16:32   ` Markus Elfring
@ 2020-11-05 17:28   ` Markus Elfring
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2020-11-05 17:28 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Coccinelle

> If you want to ensure that your generated code has such properties, you
> can use the argument --smpl-spacing.

Can there be a need for a related run time parameter for the handling
of line breaks?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-05 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 15:06 [Cocci] Checking the handling of spaces before opening parentheses for source code transformations Markus Elfring
2020-11-05 15:49 ` Julia Lawall
2020-11-05 16:32   ` Markus Elfring
2020-11-05 17:28   ` Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).