Merge lp://qastaging/~zomux/twistedchecker/auto-find-exception into lp://qastaging/~twistedchecker-dev/twistedchecker/trunk

Proposed by raphael shu
Status: Merged
Approved by: Jonathan Lange
Approved revision: 23
Merged at revision: 26
Proposed branch: lp://qastaging/~zomux/twistedchecker/auto-find-exception
Merge into: lp://qastaging/~twistedchecker-dev/twistedchecker/trunk
Diff against target: 368 lines (+315/-0)
4 files modified
twistedchecker/core/exceptionfinder.py (+84/-0)
twistedchecker/core/runner.py (+93/-0)
twistedchecker/test/test_exceptionfinder.py (+91/-0)
twistedchecker/test/test_runner.py (+47/-0)
To merge this branch: bzr merge lp://qastaging/~zomux/twistedchecker/auto-find-exception
Reviewer Review Type Date Requested Status
Jonathan Lange Approve
Review via email: mp+119316@code.qastaging.launchpad.net

Description of the change

Automatically find name exceptions for functions, methods and classes in Twisted.

Detail:
1. Find patterns like 'getattr(something, "state_%s" % foo)' and 'getattr(something, "state_" + foo)' and generate a list of these patterns (end with underscore).
2. modify regex that verifies function, method and class name in NameChecker, to ignore these patterns.

Currently found patterns in Twisted:
telnet_, sync_, _fromString_, auth_, perspective_, handleStatus_, Record_, _parseSVNEntries_, get_, xmlrpc_, state_, iac_, macro_, handle_, start_, _process_, ctcpReply_, parse_, dcc_, _toString_, observe_, func_, async_, spew_, soap_, _stat_, convert_, channel_, ftp_, global_, packet_, removeTrigger_, ext_, class_, opt_, do_, request_, render_, ssh_, _unjelly_, response_, agentc_, cmd_, key_, ctcpQuery_, generate_, view_, ssh_USERAUTH_PK_OK_, end_, oscar_, type_, irc_, search_, remote_, linemode_, decode_, visitNode_a_, login_, visitNode_

Invalid names remain in Twisted:
check_, dont_, esmtpState_, inotify_, inotify_, on_, packRequest_, parseRequest_, smtpState_, testAddingBadProtos_, will_, wont_, testAlreadyCalledDebug_, testAlreadyCalled_

To post a comment you must log in.
21. By raphael shu

fixed style issues

22. By raphael shu

fixed spelling issue

23. By raphael shu

fixed problem for name begins with underscore

Revision history for this message
Jonathan Lange (jml) wrote :

The tests for exceptionfinder aren't really unit tests, but rather integration tests. I don't think that should block landing at this point though.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: