Merge lp://qastaging/~zomux/twistedchecker/enhance-function-method-class-checking into lp://qastaging/~twistedchecker-dev/twistedchecker/trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | raphael shu | ||||
Proposed branch: | lp://qastaging/~zomux/twistedchecker/enhance-function-method-class-checking | ||||
Merge into: | lp://qastaging/~twistedchecker-dev/twistedchecker/trunk | ||||
Prerequisite: | lp://qastaging/~zomux/twistedchecker/check-function-name | ||||
Diff against target: |
111 lines (+62/-3) 4 files modified
twistedchecker/configuration/pylintrc (+22/-3) twistedchecker/functionaltests/classname_pass.py (+7/-0) twistedchecker/functionaltests/functionname_pass.py (+16/-0) twistedchecker/functionaltests/methodname_pass.py (+17/-0) |
||||
To merge this branch: | bzr merge lp://qastaging/~zomux/twistedchecker/enhance-function-method-class-checking | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange | Disapprove | ||
Review via email:
|
Description of the change
As there are many special names in Twisted,
the rule should be more flexible to cover these names.
For function/method names:
1. Names like foo_BAR, foo_BAR_BAZ.
ex. agentc_
2. Names begin with underscore, as they are special,
we should not check them.
3. Names with specific patterns.
ex. dictCode_221_ready, on_suspend_clicked, opt_mime_type.
These patterns include:
channel_
inotify_
smtpState_
will_,wont_
For class names:
1. Ignore names begin with:
Record_
Unmerged revisions
- 15. By raphael shu
-
check method/
function/ class name for twisted - 14. By raphael shu
-
added some special cases
- 13. By raphael shu
-
enhance for twisted
- 12. By raphael shu
-
added tests for method name checking
This is interesting.
Clearly, we need some support for special cases. However, there are a few disadvantages to this approach:
* regexes this long and complicated are almost impossible to maintain
* just putting the special cases into the regex means that there's no way to figure out *why* they are special
* some of the names simply represent mistakes in Twisted's code base -- not everything in trunk currently conforms to the coding standard. when those mistakes are fixed, there's nothing to signal that these regexes need to be updated.
* it makes twistedchecker less useful for other projects that follow Twisted's coding standard (e.g. lp:divmod.org)
What other options do we have?
Definitely in favour of fixing regexes for foo_BAR and foo_BAR_BAZ style names.
jml