WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
27549
Make run-webkit-lint supports files as arguments
https://bugs.webkit.org/show_bug.cgi?id=27549
Summary
Make run-webkit-lint supports files as arguments
Kenneth Rohde Christiansen
Reported
2009-07-22 11:19:09 PDT
Make run-webkit-lint supports files as arguments so that we dont need to call python WebKitTools/Scripts/modules/cpplint.py on individual files. Patch coming up.
Attachments
Make run-webkit-lint supports files as arguments
(2.62 KB, patch)
2009-07-22 11:22 PDT
,
Kenneth Rohde Christiansen
levin
: review-
Details
Formatted Diff
Diff
Updates and improved patch
(4.75 KB, patch)
2009-07-29 06:03 PDT
,
Kenneth Rohde Christiansen
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Kenneth Rohde Christiansen
Comment 1
2009-07-22 11:22:13 PDT
Created
attachment 33274
[details]
Make run-webkit-lint supports files as arguments
David Levin
Comment 2
2009-07-23 09:03:37 PDT
Comment on
attachment 33274
[details]
Make run-webkit-lint supports files as arguments Thanks for the patch. This is a nice addition. Just a few things to address at the moment. Well, first off, sorry, I changed the name of the tool on you. So if you would switch the patch over to check-webkit-style, that would be excellent. fwiw, you don't need to request me as the reviewer - Adam has been also reviewing these and doing a great job (The funny thing is that it delayed your review because I typically scan the general queue -- not used to being asked for by name). cc'ing me did get my attention though :)
> diff --git a/WebKitTools/Scripts/run-webkit-lint b/WebKitTools/Scripts/run-webkit-lint
Please fix up "cpplint._USAGE" to reflect the fact that you may optionally pass in files. What should happen if the user passes in --git-commit and files? (Personally I recommend something simple like an error message that you need to choose one or the other.)
> + if not filenames: > + cwd = os.path.abspath('.') > + scm = detect_scm_system(cwd) > + > + process_patch(scm.create_patch()) > + else: > + # Change stderr to write with replacement characters so we don't die > + # if we try to print something containing non-ASCII characters. > + sys.stderr = codecs.StreamReaderWriter(sys.stderr, > + codecs.getreader('utf8'), > + codecs.getwriter('utf8'), > + 'replace')
If this is useful (and I think it is), it seems like it would be needed for both code paths, so I'd move this outside of the "if".
> + > + for filename in filenames: > + cpplint.process_file(filename)
Kenneth Rohde Christiansen
Comment 3
2009-07-29 06:03:30 PDT
Created
attachment 33712
[details]
Updates and improved patch
David Levin
Comment 4
2009-07-29 08:04:14 PDT
Comment on
attachment 33712
[details]
Updates and improved patch I'm willing to do these changes, but I'd like to know how you feel about the "consider" comments.
> diff --git a/WebKitTools/Scripts/check-webkit-style b/WebKitTools/Scripts/check-webkit-style > + The file parameter is optional and multiple file scan be passed in. Leaving
Consider: The file parameter is optional and multiple files to scan may be passed in
> + out the file parameter will apply the check to the files currently not
Consider: out the file parameter will apply the check to the files changed according to the scm system.
> + if files and "--git-commit" in flags: > + sys.stderr.write("ERROR: It is not possible to check files " > + "and a specific commit at the same time.\n" + cpp_style._USAGE) > sys.exit(1) > + elif files:
Make this an "if" since the pre if "exits".
Kenneth Rohde Christiansen
Comment 5
2009-07-29 08:08:15 PDT
I feel fine about these changes.
Kenneth Rohde Christiansen
Comment 6
2009-07-29 08:13:58 PDT
Comment on
attachment 33712
[details]
Updates and improved patch Landed (with the above changes) in 46542.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug