Completed
Push — master ( 07ef42...4ababe )
by Michael
10s
created

status()   B

Complexity

Conditions 4

Size

Total Lines 39

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 4

Importance

Changes 7
Bugs 0 Features 0
Metric Value
cc 4
c 7
b 0
f 0
dl 0
loc 39
ccs 15
cts 15
cp 1
crap 4
rs 8.5806
1 3
import changes
2 3
from changes.models import changes_to_release_type
3
4 3
from . import info, note, highlight
5
6
7 3
def status():
8 3
    repository = changes.project_settings.repository
9 3
    info('Status [{}/{}]'.format(
10
        repository.owner,
11
        repository.repo,
12
    ))
13
14 3
    info(
15
        'Repository: ' +
16
        highlight(
17
            '{}/{}'.format(repository.owner, repository.repo),
18
        )
19
    )
20
21 3
    info('Latest Version')
22 3
    note(repository.latest_version)
23
24 3
    info('Changes')
25 3
    unreleased_changes = repository.changes_since_last_version
26 3
    note('{} changes found since {}'.format(
27
        len(unreleased_changes),
28
        repository.latest_version,
29
    ))
30
31 3
    for pull_request in unreleased_changes:
32 3
        note('#{} {} by @{}{}'.format(
33
            pull_request.number,
34
            pull_request.title,
35
            pull_request.author,
36
            ' [{}]'.format(
37
                ','.join(pull_request.labels)
38
            ) if pull_request.labels else '',
39
        ))
40
41 3
    bumpversion_part, release_type, proposed_version = changes_to_release_type(repository)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (90/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
42 3
    if unreleased_changes:
43 3
        info('Computed release type {} from changes issue tags'.format(release_type))
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (85/79).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
44 3
        info('Proposed version bump {} => {}'.format(
45
            repository.latest_version, proposed_version
46
        ))
47