Merge lp://qastaging/~sergiusens/snapcraft/less-source into lp://qastaging/~snappy-dev/snapcraft/core

Proposed by Sergio Schvezov
Status: Superseded
Proposed branch: lp://qastaging/~sergiusens/snapcraft/less-source
Merge into: lp://qastaging/~snappy-dev/snapcraft/core
Prerequisite: lp://qastaging/~sergiusens/snapcraft/less-complex-collect
Diff against target: 603 lines (+310/-190)
6 files modified
snapcraft/__init__.py (+46/-147)
snapcraft/common.py (+5/-0)
snapcraft/plugins/tar_content.py (+7/-2)
snapcraft/sources.py (+186/-0)
snapcraft/tests/test_base_plugin.py (+5/-41)
snapcraft/tests/test_sources.py (+61/-0)
To merge this branch: bzr merge lp://qastaging/~sergiusens/snapcraft/less-source
Reviewer Review Type Date Requested Status
Sergio Schvezov Approve
Michael Vogt (community) Approve
Leo Arias (community) Approve
Review via email: mp+269547@code.qastaging.launchpad.net

This proposal has been superseded by a proposal from 2015-09-01.

Commit message

Moving source management complexity out of the base plugin

Description of the change

Mostly fixing the 22 in the mccabe output 163:1: 'BasePlugin.get_source' 22 and decoupling source management from the plugin

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

this mccabe check is helping a lot, nice work Sergio.

In cases like this:
363 + def __init__(self, source, source_type=None, source_tag=None, source_branch=None):
364 + super().__init__(source, source_type, source_tag, source_branch)
365 + if source_tag and source_branch:
366 + raise IncompatibleOptionsError('can\'t specify both source-tag and source-branch for a mercurial source')

If you do the argument validation before the call to super.__init__, you will safe a few instructions.
Good to have, but no blocker. +1.

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

This is really nice work, thanks for doing this! Its a great branch that reduces the complexity and makes everything more modular and easier to read. I put some comments inline but no blockers and not really important, just my 0.02¢ :)

review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :
Revision history for this message
Sergio Schvezov (sergiusens) :
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Re approving the minor review request (code comment)

review: Approve
Revision history for this message
Snappy Tarmac (snappydevtarmac) wrote :

Unmerged revisions

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