Merge lp:~jtv/launchpad/recife-test_translatablemessage-cleanup into lp:~launchpad/launchpad/recife
| Status: | Merged |
|---|---|
| Approved by: | Данило Шеган on 2010-11-16 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 9193 |
| Proposed branch: | lp:~jtv/launchpad/recife-test_translatablemessage-cleanup |
| Merge into: | lp:~launchpad/launchpad/recife |
| Diff against target: |
73 lines (+9/-12) 1 file modified
lib/lp/translations/tests/test_translatablemessage.py (+9/-12) |
| To merge this branch: | bzr merge lp:~jtv/launchpad/recife-test_translatablemessage-cleanup |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Данило Шеган (community) | code | 2010-11-16 | Approve on 2010-11-16 |
|
Review via email:
|
|||
Commit Message
test_translatab
Description of the Change
= Pre-cleanup of test_translatab
This is a preparation for unrelated changes to the same file in work on our Recife feature branch. I'm cleaning up several things in that test:
1. Base class used by all test cases is not a test case, yet inherits from TestCaseWithFac
2. Useless "test suite" boilerplate at the end of the test. Not needed nowadays. Also takes an import with it.
3. Bad indent. Our coding guidelines forbid method calls in the style of
foo.
To test, run just this one test:
{{{
./bin/test -vvc lp.translations
}}}
No Q/A required, no lint found.
Jeroen
| Данило Шеган (danilo) wrote : | # |
I mean, all is good (not "otherwise"), since the style you are using is definitely acceptable.
| Jeroen T. Vermeulen (jtv) wrote : | # |
Yes, it's weird. I never liked this style for definitions either. I used to indent like that for my first decade or so of C/C++ programming, but found that I like the fixed-indent style better.
I looked for possible justifications for having definitions and calls different, and found only these:
1. For a definition, indenting the continuation with a single tab brings you to the same level as the actual contents of the definition.
There's other ways of dealing with that though; a syntax-coloured docstring will provide a clear distinction for instance.
2. Re-indentation work when editing (grrr) is less likely to get out of hand in a definition than in calls.
That's only an argument of risk limitation though; it doesn't say that one is more or less likely to be more work than the other in the average case.
I wouldn't bother too much with changing the review rules here though, as per my rule of thumb that it's probably a waste of time to impose new rules unless we're also going back to fix the bulk of existing practice. What's already in the file is a much stronger and earlier influence than review rules.
Jeroen

I find rule 3 very weird. One of the suggested styles for function *definitions* is that one, and you are even using that style for class definition where you inherit multiple classes. That smells of inconsistency in our style guide and should probably be fixed. We recently discussed (in the reviewers meeting) changing function definition style to not allow this style either, but I think the consensus was that we don't want to disallow it. Perhaps we should raise it in the reviewers meeting again to change *function call* style instead.
All good otherwise, thanks for the clean-up.