| Summary: | check-webkit-style: allow all upper case value in ResourceRequestBase::Requester | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Yury Semikhatsky <yurys> |
| Component: | Tools / Tests | Assignee: | Yury Semikhatsky <yurys> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | darin, hi, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 240681 | ||
|
Description
Yury Semikhatsky
2022-05-17 12:36:24 PDT
Pull request: https://github.com/WebKit/WebKit/pull/685 Committed r294353 (250660@main): <https://commits.webkit.org/250660@main> Reviewed commits have been landed. Closing PR #685 and removing active labels. Seems like a special case for the value "XHR" would be better than a special case for an enumeration of a particular name. (In reply to Darin Adler from comment #4) > Seems like a special case for the value "XHR" would be better than a special > case for an enumeration of a particular name. Yeah, I started with that but then decided to keep it in line with other enums, e.g. NSType has both all upper case and camel case values. Can change that to add exception for a bunch of common abbreviations instead (URL, XHR etc)if you have strong preference. (In reply to Yury Semikhatsky from comment #5) > (In reply to Darin Adler from comment #4) > > Seems like a special case for the value "XHR" would be better than a special > > case for an enumeration of a particular name. > > Yeah, I started with that but then decided to keep it in line with other > enums, e.g. NSType has both all upper case and camel case values. Can change > that to add exception for a bunch of common abbreviations instead (URL, XHR > etc)if you have strong preference. I don’t think the way we are handling the other enumerations based on the names of the enumerations is good. I think a list of actual all capital values would be much better. Those would self-evidently be correct. Whereas names of enumerations could be reused in different namespaces, and it’s not at all clear why these enumerations are special. So I would have started doing exceptions by value for this one, "XHR", and also considered migrating the other exceptions too. Or maybe there’s an even better scheme. I don’t think the list of enumeration type names is a good scheme. (In reply to Darin Adler from comment #6) > (In reply to Yury Semikhatsky from comment #5) > > (In reply to Darin Adler from comment #4) > > > Seems like a special case for the value "XHR" would be better than a special > > > case for an enumeration of a particular name. > > > > Yeah, I started with that but then decided to keep it in line with other > > enums, e.g. NSType has both all upper case and camel case values. Can change > > that to add exception for a bunch of common abbreviations instead (URL, XHR > > etc)if you have strong preference. > > I don’t think the way we are handling the other enumerations based on the > names of the enumerations is good. I think a list of actual all capital > values would be much better. Those would self-evidently be correct. Whereas > names of enumerations could be reused in different namespaces, and it’s not > at all clear why these enumerations are special. > > So I would have started doing exceptions by value for this one, "XHR", and > also considered migrating the other exceptions too. > I can easily add exceptions for the values of Meridiem, NSType and Requester from the current list, but it will not work for JSTokenType which has too many values and they look like plain violations of the style rule: https://github.com/WebKit/WebKit/blob/b1494de3e5ef6bda876a9d26e5b2f618ba620330/Source/JavaScriptCore/parser/ParserTokens.h#L63 In that case the most practical approach would be to keep enum name exception for JSTokenType and add exceptions for the values of the other enums and remove them from _ALLOW_ALL_UPPERCASE_ENUM. WDYT? Yes, that’s a great next step. I think for JSTokenType we might just just consider actually changing them enumeration values at some point. I’m not sure these need to be all uppercase. Whereas "XHR" has to be! |