[webkit-dev] Code Style Guideline entry about a space in empty braces
Abrar Protyasha
a_protyasha at apple.com
Fri Jun 14 08:00:00 PDT 2024
There is one section in the style guide about spacing around brace initialization <https://webkit.org/code-style-guidelines/#spacing-braced-init:~:text=href=%22%23-,spacing-braced-init,-%22%20name=>, which is a little informative and certainly applies for one class of empty braces. check-webkit-style helps satisfy said rule, but I think it’s overzealous in its identification of missing spaces inside an empty brace since the style guide doesn’t prescribe anything about this in general.
Having said that, I think we should converge to unconditionally placing spaces inside empty braces, for which we would want to update the coding style guide. Conveniently, check-webkit-style has already been checking for that, so we must not have committed too many violations! (some grepping indicates 30141 instances of { } vs 626 instances of {} under Source/)
> On Jun 14, 2024, at 00:37, Kohei.Asano--- via webkit-dev <webkit-dev at lists.webkit.org> wrote:
>
> Hi. I'm now working on clang-format refinement for WebKit style. Although pre-set for WebKit is unused on WebKit/WebKit itself as we seehttps://github.com/WebKit/WebKit/blob/e91b9416d35d02968ccb1554d14e94568c762be5/.clang-format#L2, I'll add missing features of clang-format itself to make consistent with WebKit code style.
>
> A maintainer catches that we should take care about WebKit Code Style Guideline, in the patch that adds a missed featurehttps://github.com/llvm/llvm-project/pull/93634#discussion_r1632439352. So I wouldn't update WebKit pre-set on clang-format.
>
> I found Code Style Guideline misses an entry about empty braces, while check-webkit-style catches. I also created bugzilla tickethttps://bugs.webkit.org/show_bug.cgi?id=275309 and candidate doc update patch https://github.com/WebKit/WebKit/pull/29668
>
> Which is better to update Code Style Guideline or check-webkit-style?
>
> Thanks in advance.
>
> Kohei
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org <mailto:webkit-dev at lists.webkit.org>
> https://lists.webkit.org/mailman/listinfo/webkit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20240614/316f9a14/attachment.htm>
More information about the webkit-dev
mailing list