On Tue, 06 Apr 2010 15:33:31 -0000, Aaron Bentley <email address hidden> wrote:
> On 04/05/2010 05:39 PM, James Westby wrote:
>
> >> Was there any lint?
> >
> > I don't know, running "make lint" runs it on lots of unexpected files.
>
> When there are no uncommitted changes, "make lint" compares your tree to
> the parent branch to determine which files it runs against. This means
> it will also lint files changed by your prerequisite branch. You parent
> branch may also be out of date.
I am using pipelines, so I would have thought it would run against the
previous pipe?
> You can also run bin/lint.sh with the list of files you modified. If
> you use pipelines and have the lp-review-body plugin installed, you can
> use lp-propose (formerly lp-submit) and it will use the previous pipe to
> determine which files to lint.
That's what I used (at least for one of these proposals,) but I didn't
have the extra plugin installed.
> lib/canonical/launchpad/interfaces/_schema_circular_imports.py
> 43: 'IBranchTarget' imported but unused
Fixed.
> lib/lp/code/interfaces/branch.py
> 11: undefined name 'UnknownBranchTypeError' in __all__
Fixed.
> lib/lp/code/interfaces/webservice.py
> 8: 'BranchMergeProposalExists' imported but unused
> 9: 'BranchCreatorNotOwner' imported but unused
> 9: 'IBranchSet' imported but unused
> 9: 'IBranch' imported but unused
> 9: 'BranchExists' imported but unused
> 9: 'BranchCreatorNotMemberOfOwnerTeam' imported but unused
> 12: 'IBranchMergeProposal' imported but unused
> 13: 'IBranchSubscription' imported but unused
> 14: 'ICodeImport' imported but unused
> 15: 'ICodeReviewComment' imported but unused
> 16: 'ICodeReviewVoteReference' imported but unused
> 17: 'IStaticDiff' imported but unused
> 17: 'IDiff' imported but unused
> 17: 'IPreviewDiff' imported but unused
Noise. This file is purely for importing.
> lib/lp/registry/model/sourcepackage.py
> 684: local variable 'displayname' is assigned to but never used
Fixed.
> lib/lp/code/interfaces/branch.py
> 442: [C0322, IBranch.setOwner] Operator not preceded by a space
> title=_("The new owner of the branch."),
> ^
> schema=IPerson))
> @export_write_operation()
> def setOwner(new_owner, user):
> 451: [C0322, IBranch.setTarget] Operator not preceded by a space
> title=_("The project the branch belongs to."),
> ^
> schema=Interface, required=False), # Really IProduct
> source_package=Reference(
> title=_("The source package the branch belongs to."),
> schema=Interface, required=False)) # Really ISourcePackage
> @export_write_operation()
> def setTarget(user, project=None, source_package=None):
> 511: [C0322, IBranch.isPersonTrustedReviewer] Operator not preceded
> by a space
> title=_("A person for which the reviewer status is in question."),
> ^
> schema=IPerson))
> @export_read_operation()
> def isPersonTrustedReviewer(reviewer):
> 760: [C0322, IBranch._createMergeProposal] Operator not preceded by
> a space
> needs_review=Bool(title=_('Needs review'),
> ^
> description=_('If True the proposal needs review.'
> 'Otherwise, it will be work in progress.')),
> initial_comment=Text(
> title=_('Initial comment'),
> description=_("Registrant's initial description of proposal.")),
> commit_message=Text(
> title=_('Commit message'),
> description=_('Message to use when committing this merge.')),
> reviewers=List(value_type=Reference(schema=IPerson)),
> review_types=List(value_type=TextLine())
> )
>
>
> @call_with(registrant=REQUEST_USER)
>
> @export_factory_operation(Interface, [])
> def _createMergeProposal(
> registrant, target_branch, prerequisite_branch=None,
> needs_review=True, initial_comment=None, commit_message=None,
> reviewers=None, review_types=None):
> 937: [C0322, IBranch.subscribe] Operator not preceded by a space
> schema=IPerson),
> ^
> notification_level=Choice(
> title=_("The level of notification to subscribe to."),
> vocabulary=BranchSubscriptionNotificationLevel),
> max_diff_lines=Choice(
> title=_("The max number of lines for diff email."),
> vocabulary=BranchSubscriptionDiffSize),
> code_review_level=Choice(
> title=_("The level of code review notification emails."),
> vocabulary=CodeReviewNotificationLevel))
> @operation_returns_entry(Interface) # Really IBranchSubscription
> @export_write_operation()
> def subscribe(person, notification_level, max_diff_lines,
> code_review_level):
> 965: [C0322, IBranch.getSubscription] Operator not preceded by a space
> schema=IPerson))
> ^
> @operation_returns_entry(Interface) # Really IBranchSubscription
> @export_read_operation()
> def getSubscription(person):
> 976: [C0322, IBranch.unsubscribe] Operator not preceded by a space
> title=_("The person to unsubscribe"),
> ^
> schema=IPerson))
> @export_write_operation()
> def unsubscribe(person):
> 1226: [C0322, IBranchSet.getByUrls] Operator not preceded by a space
> title=u'A list of URLs of branches',
> ^
> description=(
> u'These can be URLs external to '
> u'Launchpad, lp: URLs, or http://bazaar.launchpad.net/ URLs, '
> u'or any mix of all these different kinds.'),
> value_type=TextLine(),
> required=True))
> @export_read_operation()
> def getByUrls(urls):
Noise.
> lib/lp/code/interfaces/hasbranches.py
> 104: [C0301] Line too long (79/78)
Fixed.
> 42: [E0213, IHasBranches.getBranches] Method should have "self" as
> first argument
> 42: [C0322, IHasBranches.getBranches] Operator not preceded by a space
> modified_since=Datetime(
> ^
> title=_('Limit the branches to those modified since this date.'),
> required=False))
> @call_with(visible_by_user=REQUEST_USER)
> @operation_returns_collection_of(Interface) # Really IBranch.
> @export_read_operation()
> def getBranches(status=None, visible_by_user=None,
> modified_since=None):
> 74: [E0213, IHasMergeProposals.getMergeProposals] Method should
> have "self" as first argument
> 100: [E0213, IHasRequestedReviews.getRequestedReviews] Method
> should have "self" as first argument
> 128: [E0213, IHasCodeImports.newCodeImport] Method should have
> "self" as first argument
> 128: [C0322, IHasCodeImports.newCodeImport] Operator not preceded
> by a space
> rcs_type=Choice(vocabulary=RevisionControlSystems, required=True),
> ^
> url=TextLine(title=_('Foreign VCS URL')),
> cvs_root=TextLine(title=_('CVS root URL')),
> cvs_module=TextLine(title=_('CVS module to import')),
> owner=Reference(title=_('Owner of the resulting branch'),
> schema=Interface)
> )
> @call_with(registrant=REQUEST_USER)
> @export_factory_operation(Interface, []) # Really ICodeImport.
> def newCodeImport(registrant=None, branch_name=None, rcs_type=None,
> url=None, cvs_root=None, cvs_module=None, owner=None):
Noise.
> lib/lp/code/model/branchtarget.py
> 328: [W0231, ProductSeriesBranchTarget.__init__] __init__ method
> from base class 'ProductBranchTarget' is not called
Fixed.
> lib/lp/code/model/hasbranches.py
> 64: [C0301] Line too long (79/78)
> lib/lp/registry/interfaces/sourcepackage.py
> 189: [C0322, ISourcePackage.getBranch] Operator not preceded by a space
> vocabulary=DBEnumeratedType))
> ^
>
>
> @operation_returns_entry(Interface)
> @export_read_operation()
> def getBranch(pocket):
> 207: [C0322, ISourcePackage.setBranch] Operator not preceded by a space
> vocabulary=DBEnumeratedType),
> ^
> branch=Reference(Interface, title=_("Branch"), required=False))
> @call_with(registrant=REQUEST_USER)
> @export_write_operation()
> def setBranch(pocket, branch, registrant):
Noise.
> Some of these may be bogus, but many of them should be fixed. You
> should suppress the pylint warnings in lib/lp/code/interfaces/hasbranches.py
Done.
> >> What would you think about expressing xx-code-import.txt's "Exceptions"
> >> heading as a unit test? Failing that, it needs two blank lines separating it
> >> from the previous section.
> >
> > I don't know how to do webservice tests as unit tests, if you can point me to
> > examples I will convert them.
>
> What works in doctests will usually work in unit tests:
On Tue, 06 Apr 2010 15:33:31 -0000, Aaron Bentley <email address hidden> wrote:
> On 04/05/2010 05:39 PM, James Westby wrote:
>
> >> Was there any lint?
> >
> > I don't know, running "make lint" runs it on lots of unexpected files.
>
> When there are no uncommitted changes, "make lint" compares your tree to
> the parent branch to determine which files it runs against. This means
> it will also lint files changed by your prerequisite branch. You parent
> branch may also be out of date.
I am using pipelines, so I would have thought it would run against the
previous pipe?
> You can also run bin/lint.sh with the list of files you modified. If
> you use pipelines and have the lp-review-body plugin installed, you can
> use lp-propose (formerly lp-submit) and it will use the previous pipe to
> determine which files to lint.
That's what I used (at least for one of these proposals,) but I didn't
have the extra plugin installed.
> lib/canonical/ launchpad/ interfaces/ _schema_ circular_ imports. py
> 43: 'IBranchTarget' imported but unused
Fixed.
> lib/lp/ code/interfaces /branch. py ypeError' in __all__
> 11: undefined name 'UnknownBranchT
Fixed.
> lib/lp/ code/interfaces /webservice. py posalExists' imported but unused otOwner' imported but unused otMemberOfOwner Team' imported but unused oposal' imported but unused ption' imported but unused ment' imported but unused eReference' imported but unused
> 8: 'BranchMergePro
> 9: 'BranchCreatorN
> 9: 'IBranchSet' imported but unused
> 9: 'IBranch' imported but unused
> 9: 'BranchExists' imported but unused
> 9: 'BranchCreatorN
> 12: 'IBranchMergePr
> 13: 'IBranchSubscri
> 14: 'ICodeImport' imported but unused
> 15: 'ICodeReviewCom
> 16: 'ICodeReviewVot
> 17: 'IStaticDiff' imported but unused
> 17: 'IDiff' imported but unused
> 17: 'IPreviewDiff' imported but unused
Noise. This file is purely for importing.
> lib/lp/ registry/ model/sourcepac kage.py
> 684: local variable 'displayname' is assigned to but never used
Fixed.
> lib/lp/ code/interfaces /branch. py write_operation () package= Reference( write_operation () package= None): isPersonTrusted Reviewer] Operator not preceded read_operation( ) Reviewer( reviewer) : _createMergePro posal] Operator not preceded by Bool(title= _('Needs review'), comment= Text( _("Registrant' s initial description of proposal.")), message= Text( _('Message to use when committing this merge.')), List(value_ type=Reference( schema= IPerson) ), types=List( value_type= TextLine( )) registrant= REQUEST_ USER) factory_ operation( Interface, []) posal( branch= None, comment= None, commit_ message= None, level=Choice( BranchSubscript ionNotification Level), lines=Choice( BranchSubscript ionDiffSize) , level=Choice( CodeReviewNotif icationLevel) ) returns_ entry(Interface ) # Really IBranchSubscription write_operation () getSubscription ] Operator not preceded by a space returns_ entry(Interface ) # Really IBranchSubscription read_operation( ) (person) : unsubscribe] Operator not preceded by a space write_operation () person) : getByUrls] Operator not preceded by a space bazaar. launchpad. net/ URLs, ' TextLine( ), read_operation( )
> 442: [C0322, IBranch.setOwner] Operator not preceded by a space
> title=_("The new owner of the branch."),
> ^
> schema=IPerson))
> @export_
> def setOwner(new_owner, user):
> 451: [C0322, IBranch.setTarget] Operator not preceded by a space
> title=_("The project the branch belongs to."),
> ^
> schema=Interface, required=False), # Really IProduct
> source_
> title=_("The source package the branch belongs to."),
> schema=Interface, required=False)) # Really ISourcePackage
> @export_
> def setTarget(user, project=None, source_
> 511: [C0322, IBranch.
> by a space
> title=_("A person for which the reviewer status is in question."),
> ^
> schema=IPerson))
> @export_
> def isPersonTrusted
> 760: [C0322, IBranch.
> a space
> needs_review=
> ^
> description=_('If True the proposal needs review.'
> 'Otherwise, it will be work in progress.')),
> initial_
> title=_('Initial comment'),
> description=
> commit_
> title=_('Commit message'),
> description=
> reviewers=
> review_
> )
>
>
> @call_with(
>
> @export_
> def _createMergePro
> registrant, target_branch, prerequisite_
> needs_review=True, initial_
> reviewers=None, review_types=None):
> 937: [C0322, IBranch.subscribe] Operator not preceded by a space
> schema=IPerson),
> ^
> notification_
> title=_("The level of notification to subscribe to."),
> vocabulary=
> max_diff_
> title=_("The max number of lines for diff email."),
> vocabulary=
> code_review_
> title=_("The level of code review notification emails."),
> vocabulary=
> @operation_
> @export_
> def subscribe(person, notification_level, max_diff_lines,
> code_review_level):
> 965: [C0322, IBranch.
> schema=IPerson))
> ^
> @operation_
> @export_
> def getSubscription
> 976: [C0322, IBranch.
> title=_("The person to unsubscribe"),
> ^
> schema=IPerson))
> @export_
> def unsubscribe(
> 1226: [C0322, IBranchSet.
> title=u'A list of URLs of branches',
> ^
> description=(
> u'These can be URLs external to '
> u'Launchpad, lp: URLs, or http://
> u'or any mix of all these different kinds.'),
> value_type=
> required=True))
> @export_
> def getByUrls(urls):
Noise.
> lib/lp/ code/interfaces /hasbranches. py
> 104: [C0301] Line too long (79/78)
Fixed.
> 42: [E0213, IHasBranches. getBranches] Method should have "self" as getBranches] Operator not preceded by a space since=Datetime( visible_ by_user= REQUEST_ USER) returns_ collection_ of(Interface) # Really IBranch. read_operation( ) status= None, visible_ by_user= None, since=None) : als.getMergePro posals] Method should views.getReques tedReviews] Method .newCodeImport] Method should have .newCodeImport] Operator not preceded Choice( vocabulary= RevisionControl Systems, required=True), title=_ ('Foreign VCS URL')), TextLine( title=_ ('CVS root URL')), TextLine( title=_ ('CVS module to import')), (title= _('Owner of the resulting branch'), registrant= REQUEST_ USER) factory_ operation( Interface, []) # Really ICodeImport. registrant= None, branch_name=None, rcs_type=None,
> first argument
> 42: [C0322, IHasBranches.
> modified_
> ^
> title=_('Limit the branches to those modified since this date.'),
> required=False))
> @call_with(
> @operation_
> @export_
> def getBranches(
> modified_
> 74: [E0213, IHasMergePropos
> have "self" as first argument
> 100: [E0213, IHasRequestedRe
> should have "self" as first argument
> 128: [E0213, IHasCodeImports
> "self" as first argument
> 128: [C0322, IHasCodeImports
> by a space
> rcs_type=
> ^
> url=TextLine(
> cvs_root=
> cvs_module=
> owner=Reference
> schema=Interface)
> )
> @call_with(
> @export_
> def newCodeImport(
> url=None, cvs_root=None, cvs_module=None, owner=None):
Noise.
> lib/lp/ code/model/ branchtarget. py anchTarget. __init_ _] __init__ method arget' is not called
> 328: [W0231, ProductSeriesBr
> from base class 'ProductBranchT
Fixed.
> lib/lp/ code/model/ hasbranches. py
> 64: [C0301] Line too long (79/78)
Fixed
> lib/lp/ registry/ interfaces/ product. py createProduct] Operator not preceded by a t='freshmeat_ project' , wikiurl='wiki_url', 'download_ url', ect='sourceforg e_project' , ='programming_ lang') factory_ operation( ject', 'programminglang', operation_ as('new_ project' ) owner, name, displayname, title, summary, None, wikiurl=None, t=None, ect=None, programminglang =None, reviewed= False, mugshot=None, logo=None,
> 774: [C0322, IProductSet.
> space
> freshmeatprojec
> ^
> downloadurl=
> sourceforgeproj
> programminglang
> @export_
> IProduct, ['name', 'displayname', 'title', 'summary', 'description',
> 'project', 'homepageurl', 'screenshotsurl',
> 'downloadurl', 'freshmeatproject', 'wikiurl',
> 'sourceforgepro
> 'license_reviewed', 'licenses', 'license_info',
> 'registrant'])
> @export_
> def createProduct(
> description=None, project=None, homepageurl=None,
> screenshotsurl=
> downloadurl=None, freshmeatprojec
> sourceforgeproj
> license_
> icon=None, licenses=None, license_info=None,
> registrant=None):
Noise.
> lib/lp/ registry/ interfaces/ sourcepackage. py getBranch] Operator not preceded by a space DBEnumeratedTyp e)) returns_ entry(Interface ) read_operation( ) setBranch] Operator not preceded by a space DBEnumeratedTyp e), Reference( Interface, title=_("Branch"), required=False)) registrant= REQUEST_ USER) write_operation ()
> 189: [C0322, ISourcePackage.
> vocabulary=
> ^
>
>
> @operation_
> @export_
> def getBranch(pocket):
> 207: [C0322, ISourcePackage.
> vocabulary=
> ^
> branch=
> @call_with(
> @export_
> def setBranch(pocket, branch, registrant):
Noise.
> Some of these may be bogus, but many of them should be fixed. You code/interfaces /hasbranches. py
> should suppress the pylint warnings in lib/lp/
Done.
> >> What would you think about expressing xx-code- import. txt's "Exceptions"
> >> heading as a unit test? Failing that, it needs two blank lines separating it
> >> from the previous section.
> >
> > I don't know how to do webservice tests as unit tests, if you can point me to
> > examples I will convert them.
>
> What works in doctests will usually work in unit tests:
Thanks, changed.
James