Completed
Push — stage ( 901070 )
by Michael
02:42
created

stage()   A

Complexity

Conditions 3

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 3
c 2
b 0
f 0
dl 0
loc 13
ccs 7
cts 7
cp 1
crap 3
rs 9.4285
1 3
from . import info, note, error
2 3
from .status import changes_to_release_type, status
3
4
5 3
def stage(version=None):
6 3
    repository, release_type, proposed_version = status()
7
8 3
    if not repository.changes_since_last_version:
9 3
        error("There aren't any changes to release!")
10 3
        return
11
12
    # default to changes since last version
13 3
    version = version if version else proposed_version
14
15 3
    info('Staging [{}] release for version {}'.format(
16
        release_type,
17
        version
18
    ))
19