Conditions | 4 |
Total Lines | 11 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.1755 |
Changes | 0 |
1 | # coding: utf-8 |
||
26 | 1 | def get_aliases(): |
|
27 | """Get aliases from config file""" |
||
28 | 1 | config_file, _ = get_config_and_project_dir(get_config_from_argv(argv[1:])) |
|
29 | 1 | config = {} |
|
30 | 1 | try: |
|
31 | 1 | with open(config_file, 'r') as stream: |
|
32 | 1 | config = safe_load(stream) |
|
33 | except (error.YAMLError, FileNotFoundError): |
||
34 | pass |
||
35 | |||
36 | return config['aliases'] if 'aliases' in config else {} |
||
37 |