| Conditions | 4 |
| Total Lines | 42 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 15 |
| CRAP Score | 4 |
| Changes | 7 | ||
| Bugs | 0 | Features | 0 |
| 1 | 3 | import changes |
|
| 6 | 3 | def status(): |
|
| 7 | 3 | repository = changes.project_settings.repository |
|
| 8 | |||
| 9 | 3 | release = changes.release_from_pull_requests() |
|
| 10 | |||
| 11 | 3 | info('Status [{}/{}]'.format( |
|
| 12 | repository.owner, |
||
| 13 | repository.repo, |
||
| 14 | )) |
||
| 15 | |||
| 16 | 3 | info( |
|
| 17 | 'Repository: ' + |
||
| 18 | highlight( |
||
| 19 | '{}/{}'.format(repository.owner, repository.repo), |
||
| 20 | ) |
||
| 21 | ) |
||
| 22 | |||
| 23 | 3 | info('Latest Version') |
|
| 24 | 3 | note(repository.latest_version) |
|
| 25 | |||
| 26 | 3 | info('Changes') |
|
| 27 | 3 | unreleased_changes = repository.pull_requests_since_latest_version |
|
| 28 | 3 | note('{} changes found since {}'.format( |
|
| 29 | len(unreleased_changes), |
||
| 30 | repository.latest_version, |
||
| 31 | )) |
||
| 32 | |||
| 33 | 3 | for pull_request in unreleased_changes: |
|
| 34 | 3 | note('#{} {} by @{}{}'.format( |
|
| 35 | pull_request.number, |
||
| 36 | pull_request.title, |
||
| 37 | pull_request.author, |
||
| 38 | ' [{}]'.format( |
||
| 39 | ','.join(pull_request.label_names) |
||
| 40 | ) if pull_request.label_names else '', |
||
| 41 | )) |
||
| 42 | |||
| 43 | 3 | if unreleased_changes: |
|
| 44 | 3 | info('Computed release type {} from changes issue tags'.format( |
|
| 45 | release.release_type)) |
||
| 46 | 3 | info('Proposed version bump {} => {}'.format( |
|
| 47 | repository.latest_version, release.version |
||
| 48 | )) |
||
| 49 |
Cyclic imports may cause partly loaded modules to be returned. This might lead to unexpected runtime behavior which is hard to debug.