Completed
Push — init-test ( 3e12e7 )
by Michael
07:46 queued 07:14
created

changelog()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1.037

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 1
c 3
b 0
f 0
dl 0
loc 5
ccs 2
cts 3
cp 0.6667
crap 1.037
rs 9.4285
1 3
import click
0 ignored issues
show
Configuration introduced by
The import click could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
2 3
import requests_cache
0 ignored issues
show
Configuration introduced by
The import requests_cache could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
3
4 3
from . import __version__
5 3
from changes.commands import init as init_command
6
7 3
VERSION = 'changes {}'.format(__version__)
8
9
10 3
def print_version(context, param, value):
11
    if not value or context.resilient_parsing:
12
        return
13
    click.echo(VERSION)
14
    context.exit()
15
16
17 3
@click.option(
18
    '--dry-run',
19
    help='Prints (instead of executing) the operations to be performed.',
20
    is_flag=True,
21
    default=False,
22
)
23 3
@click.option(
24
    '--verbose',
25
    help='Enables verbose output.',
26
    is_flag=True,
27
    default=False,
28
)
29 3
@click.version_option(
30
    __version__,
31
    '-V',
32
    '--version',
33
    message=VERSION
34
)
35 3
@click.group(
36
    context_settings=dict(
37
        help_option_names=[u'-h', u'--help']
38
    ),
39
)
40
def main(dry_run, verbose):
41
    """Ch-ch-changes"""
42
    requests_cache.install_cache(
43
        cache_name='github_cache',
44
        backend='sqlite',
45
        expire_after=180000
46
    )
47
48
49 3
@click.command()
50
def init():
51
    """
52
    Detects, prompts and initialises the project.
53
    """
54
    init_command.init()
55
56
main.add_command(init)
57