klausgerlicher wrote:

I've spoken to one of the GNU maintainers (Bruno Haible) and he tells me that 
this behaviour for GNU is well documented:

```
This convention is documented in multiple places in the GNU gettext
documentation [1][2][3][4].

> This omission causes issues with clang-format, which treats _() as
> a regular function call and consistently inserts a space between _ and (
> during formatting. While minor, this behavior is inconvenient for
> projects following GNU conventions.

[2] actually documents the omission of the space in this context:
  "Many packages use ‘_’ (a simple underline) as a keyword, and write
   ‘_("Translatable string")’ instead of ‘gettext ("Translatable string")’.
   Further, the coding rule, from GNU standards, wanting that there is
   a space between the keyword and the opening parenthesis is relaxed,
   in practice, for this particular usage."

This has been documented like this for more than 20 years.

...there are more than 500000
occurrences of this pattern in the Debian GNU/Linux source code? [5]

[1] https://www.gnu.org/software/gettext/manual/html_node/Overview.html
[2] https://www.gnu.org/software/gettext/manual/html_node/Mark-Keywords.html
[3] https://www.gnu.org/software/gettext/manual/html_node/Libraries.html
[4] https://www.gnu.org/software/gettext/manual/html_node/C.html
[5] https://codesearch.debian.net/search?q=+_%28%22&literal=1
```

So we have all the three requirements that you stated:

- be used in a project of significant size (have dozens of contributors).
- have a publicly accessible style guide.
- have a person willing to contribute and maintain patches: I would be willing 
to stand in for this.

@owenca, would this be enough to convince you to add this option?

https://github.com/llvm/llvm-project/pull/159925
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to