Completed
Push — master ( 306974...484603 )
by Michael
51:23 queued 46:02
created

note_style()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 2
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
1 3
import click
2
3 3
STYLES = {
4
    'debug': {
5
        'fg': 'blue',
6
    },
7
    'info': {
8
        'fg': 'green',
9
        'bold': True,
10
    },
11
    'highlight': {
12
        'fg': 'cyan',
13
        'bold': True,
14
    },
15
    'note': {
16
        'fg': 'blue',
17
        'bold': True,
18
    },
19
    'error': {
20
        'fg': 'red',
21
        'bold': True,
22
    }
23
}
24
25
26 3
def echo(message, style):
27 3
    click.secho(
28
        str(message),
29
        **STYLES[style]
30
    )
31
32
33 3
def debug(message):
34 3
    echo('{}...'.format(message), 'debug')
35
36
37 3
def info(message):
38 3
    echo('{}...'.format(message), 'info')
39
40
41 3
def note(message):
42 3
    echo(message, 'note')
43
44
45 3
def note_style(message):
46
    return click.style(message, **STYLES['note'])
47
48
49 3
def highlight(message):
50 3
    return click.style(message, **STYLES['highlight'])
51
52
53 3
def error(message):
54
    echo(message, 'error')
55