Bug 51103 - check-webkit-style should check for XML syntax errors in .vcproj/.vsprops files
Summary: check-webkit-style should check for XML syntax errors in .vcproj/.vsprops files
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: Adam Roben (:aroben)
URL:
Keywords:
Depends on:
Blocks: 51139
  Show dependency treegraph
 
Reported: 2010-12-15 04:54 PST by Adam Roben (:aroben)
Modified: 2010-12-16 14:11 PST (History)
7 users (show)

See Also:


Attachments
Teach check-webkit-style to check .vcproj and .vsprops files for XML syntax errors (17.76 KB, patch)
2010-12-15 08:18 PST, Adam Roben (:aroben)
levin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2010-12-15 04:54:28 PST
It's a pretty common mistake for people to introduce XML syntax errors into .vcproj/.vsprops when editing them by hand (see bug 51029 comment 3 for some examples). It would be great if check-webkit-style could catch these errors!
Comment 1 David Levin 2010-12-15 06:54:19 PST
Sounds like you want a new checker.

Here's how to do that:

1. Add a new checker
  a. Create a file WebKitTools/Scripts/webkitpy/style/checkers/vc_proj.py
  b. Fill in the checker to do what you want. 
     i. Use WebKitTools/Scripts/webkitpy/style/checkers/text.py as a simple example.  
    ii. Name it something like VcProjChecker
  c. Create a simple unit test for it. ?(WebKitTools/Scripts/webkitpy/style/checkers/text_unittest.py is a nice example)


2. You need to teach the style checker about the new file type:
  a. In WebKitTools/Scripts/webkitpy/style/checker.py
      Add a new file type to
         class FileType:
      Something like VCPROJ
   b. Make CheckerDispatcher._file_type return this file type for vcproj/vsprops files.
   c. Make CheckerDispatcher._create_checker return your new checker: VCProjChecker

3. Enjoy the fact that these error will be caught automatically.
Comment 2 Adam Roben (:aroben) 2010-12-15 08:18:37 PST
Created attachment 76648 [details]
Teach check-webkit-style to check .vcproj and .vsprops files for XML syntax errors
Comment 3 David Levin 2010-12-15 14:12:10 PST
Comment on attachment 76648 [details]
Teach check-webkit-style to check .vcproj and .vsprops files for XML syntax errors

Excellent!
Comment 4 Adam Roben (:aroben) 2010-12-15 15:33:57 PST
Committed r74149: <http://trac.webkit.org/changeset/74149>
Comment 5 Ojan Vafai 2010-12-15 15:59:58 PST
Committed r74158: <http://trac.webkit.org/changeset/74158>
Comment 6 David Levin 2010-12-15 16:18:55 PST
Ojan something went wrong here.... Was it the commit queue or something done by hand, etc.?
Comment 7 Ojan Vafai 2010-12-15 17:00:28 PST
(In reply to comment #6)
> Ojan something went wrong here.... Was it the commit queue or something done by hand, etc.?

It was webkit-patch. This is the age-old problem of webkit-patch doing the wrong thing if the new changelog entry is not at the top. Alterately, the bug is with resolve-ChangeLogs, which did not put the changelog entry at the top when I synced.
Comment 8 Eric Seidel (no email) 2010-12-15 17:08:39 PST
https://bugs.webkit.org/show_bug.cgi?id=28291
Comment 9 Eric Seidel (no email) 2010-12-16 14:09:31 PST
This caused a python warning when running the tests under python 2.6

Something about BaseException.message being deprecated.
Comment 10 David Levin 2010-12-16 14:11:33 PST
(In reply to comment #9)
> This caused a python warning when running the tests under python 2.6
> 
> Something about BaseException.message being deprecated.

Fix is here https://bugs.webkit.org/show_bug.cgi?id=51210