Flex (http://flex.sourceforge.net/) uses identifiers named as yy_*. WebCore/css/CSSParser.cpp needs to handle some such identifiers. We should relax the style rule for the file to allow underscored identifiers.
Created attachment 48474 [details] Allow underscored identifiers in CSSParser.cpp
Comment on attachment 48474 [details] Allow underscored identifiers in CSSParser.cpp Seems unfortunate to allow any underscored names in those files when only the yy ones need to be used.
Committed r54690: <http://trac.webkit.org/changeset/54690>
(In reply to comment #2) > (From update of attachment 48474 [details]) > Seems unfortunate to allow any underscored names in those files when only the > yy ones need to be used. Yeah. I think adding an exception like following would be better (or you can even check if the filename is CSSParser.cpp here). What do you guys think? --- a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py +++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py @@ -2482,6 +2482,7 @@ def check_identifier_name_in_declaration(filename, line_nu mber, line, error): # Various exceptions to the rule: JavaScript op codes functions, co nst_iterator. if (not (filename.find('JavaScriptCore') >= 0 and modified_identifi er.find('_op_') >= 0) and not modified_identifier.startswith('tst_') + and not modified_identifier.startswith('yy_') and not modified_identifier.startswith('webkit_dom_object_') and not modified_identifier.startswith('qt_') and not modified_identifier.find('::qt_') >= 0
On second though, I should have just marked the lines using yy_* with // NOLINT. As to whether to change the rule, I think: - only very common names (e.g., m_* and s_*?) should be exempted from checking in cpp.py - file/path name based exemption should be done in one place, i.e., in checker.py, Checking file/path in multiple places will lead to confusion. - It'd be nice if NOLINT mechanism is extended such that - we can disable subset of tests rather than the whole, e.g., NOLINT:readability/naming - we can specify the range of NOLINT rather than put NOLINT all the lines, e.g., NOLINT_START, NOLINT_END