Bug 32971 - check-webkit-style: Move and rename style-related files into webkitpy/style folder
Summary: check-webkit-style: Move and rename style-related files into webkitpy/style f...
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: Chris Jerdonek
URL:
Keywords:
Depends on:
Blocks: 32973
  Show dependency treegraph
 
Reported: 2009-12-27 15:56 PST by Chris Jerdonek
Modified: 2010-01-07 00:37 PST (History)
7 users (show)

See Also:


Attachments
Proposed patch (671.48 KB, patch)
2010-01-06 08:48 PST, Chris Jerdonek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jerdonek 2009-12-27 15:56:07 PST
This task includes the following moves/renames:

              style.py -> style/checker.py
     style_unittest.py -> style/checker_unittest.py
          cpp_style.py -> style/cpp.py
 cpp_style_unittest.py -> style/cpp_unittest.py
          text_tyle.py -> style/text.py
text_style_unittest.py -> style/text_unittest.py

Also add an empty __init__.py file.
Comment 1 Chris Jerdonek 2009-12-28 17:50:10 PST
Removed brackets from bug title.
Comment 2 Chris Jerdonek 2010-01-05 18:26:39 PST
Towards creating a style package.  We can do this after--

https://bugs.webkit.org/show_bug.cgi?id=32966
Comment 3 Chris Jerdonek 2010-01-06 08:48:43 PST
Created attachment 45963 [details]
Proposed patch

To reference webkitpy modules outside of webkitpy/style, I settled on the central approach of adding the parent webkitpy directory to the style package's search path in style/__init__.py.  This is instead of using absolute or relative import statements throughout the style package.

This comes up, for example, when style/checker.py needs to import diff_parser.DiffParser.

This will minimize us needing to go in an update files in the style package as the folder hierarchy for non-style files changes.  Let me know if you have other thoughts.
Comment 4 WebKit Review Bot 2010-01-06 08:49:43 PST
style-queue ran check-webkit-style on attachment 45963 [details] without any errors.
Comment 5 Chris Jerdonek 2010-01-06 08:57:22 PST
(In reply to comment #0)
> This task includes the following moves/renames:
> 
>               style.py -> style/checker.py
>      style_unittest.py -> style/checker_unittest.py
>           cpp_style.py -> style/cpp.py
>  cpp_style_unittest.py -> style/cpp_unittest.py
>           text_tyle.py -> style/text.py
> text_style_unittest.py -> style/text_unittest.py

I ended up doing something a bit simpler than this and left cpp_style* and
text_style* alone.  I only renamed--

>               style.py -> style/checker.py
>      style_unittest.py -> style/checker_unittest.py
Comment 6 Eric Seidel (no email) 2010-01-06 08:57:33 PST
Comment on attachment 45963 [details]
Proposed patch

Looks sane enough.  We can change the __path__ hack to something else if a python guru has a better solution.
Comment 7 WebKit Commit Bot 2010-01-07 00:37:16 PST
Comment on attachment 45963 [details]
Proposed patch

Clearing flags on attachment: 45963

Committed r52906: <http://trac.webkit.org/changeset/52906>
Comment 8 WebKit Commit Bot 2010-01-07 00:37:23 PST
All reviewed patches have been landed.  Closing bug.