Bug 51452 - check-webkit-style shouldn't complaint about underscores in variables in objective C files.
Summary: check-webkit-style shouldn't complaint about underscores in variables in obje...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-22 00:09 PST by David Levin
Modified: 2010-12-22 07:35 PST (History)
3 users (show)

See Also:


Attachments
Patch (14.70 KB, patch)
2010-12-22 00:24 PST, David Levin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2010-12-22 00:09:04 PST
See summary.
Comment 1 David Levin 2010-12-22 00:24:25 PST
Created attachment 77194 [details]
Patch
Comment 2 David Levin 2010-12-22 00:26:55 PST
See https://bugs.webkit.org/show_bug.cgi?id=49481#c70
Comment 3 David Levin 2010-12-22 00:28:22 PST
Perhaps, I made the check too liberal by ignoring all _ in Objective C variables. Maybe it should only allow a single leading _. (If this is so, speak up and I believe I can adjust this.)
Comment 4 Eric Seidel (no email) 2010-12-22 02:40:32 PST
I believe only leading _ is allowed for AppKit style objc.
Comment 5 Shinichiro Hamaji 2010-12-22 05:32:05 PST
Comment on attachment 77194 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=77194&action=review

Looks good. I think it's OK to land this patch as is. If we want a stricter rule, we may be able to create another patch.

> Tools/Scripts/webkitpy/style/checkers/cpp.py:933
> +            self._is_objective_c = None

I feel we want a comment here which describes we'll guess this value in is_objective_c.
Comment 6 David Levin 2010-12-22 07:35:00 PST
Comment on attachment 77194 [details]
Patch

Landed as http://trac.webkit.org/changeset/74478.

Agreed with Shinichiro that we can make the check more strict in another patch. (It will be nice to get rid of this false positive now and I suspect the issue of underscores in variables is a less common mistake for Objective C programmers.)