[webkit-dev] Code Style Guideline entry about a space in empty braces

Kohei.Asano at sony.com Kohei.Asano at sony.com
Tue Jun 18 19:36:31 PDT 2024


Thanks Michael and Abrar.

Yeah I agree with what Abrar said. For clang-format, which has specific WebKit style, needs to care about the coding style so updating benefits for maintaining it.

I’ll appreciate other comments about this on PR<https://github.com/WebKit/WebKit/pull/29668>. If there are no other opinions, could anyone merge this PR? Thanks!

Kohei

________________________________
差出人: Abrar Protyasha <a_protyasha at apple.com>
送信日時: 2024年6月15日 0:00
宛先: Asano, Kohei (SIE) <Kohei.Asano at sony.com>
CC: webkit-dev at lists.webkit.org <webkit-dev at lists.webkit.org>
件名: Re: [webkit-dev] Code Style Guideline entry about a space in empty braces


There is one section in the style guide about spacing around brace initialization<https://webkit.org/code-style-guidelines/#spacing-braced-init:~:text=href="#-,spacing-braced-init,-" name=>, 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<https://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<https://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<https://bugs.webkit.org/show_bug.cgi?id=275309> and candidate doc update patch https://github.com/WebKit/WebKit/pull/29668<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<https://lists.webkit.org/mailman/listinfo/webkit-dev>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20240619/eeb31c17/attachment.htm>


More information about the webkit-dev mailing list