|
17 | 17 | from typing import Optional |
18 | 18 |
|
19 | 19 | from deepmerge import always_merger |
20 | | -from jsonschema.exceptions import ( |
21 | | - FormatError, |
22 | | - SchemaError, |
23 | | - UndefinedTypeCheck, |
24 | | - UnknownType, |
25 | | - ValidationError, |
26 | | -) |
| 20 | +from jsonschema.exceptions import FormatError, SchemaError, UndefinedTypeCheck, UnknownType, ValidationError |
27 | 21 |
|
28 | 22 | from .config_file import ConfigFile, Profile |
29 | 23 | from .credential_manager import CredentialManager |
30 | | -from .custom_warnings import ( |
31 | | - ConfigNotFoundWarning, |
32 | | - ProfileNotFoundWarning, |
33 | | - SecurePropsNotFoundWarning, |
34 | | -) |
| 24 | +from .custom_warnings import ConfigNotFoundWarning, ProfileNotFoundWarning, SecurePropsNotFoundWarning |
35 | 25 | from .exceptions import ProfileNotFound, SecureProfileLoadFailed, SecureValuesNotFound |
36 | 26 | from .logger import Log |
37 | | -from .profile_constants import ( |
38 | | - BASE_PROFILE, |
39 | | - GLOBAL_CONFIG_NAME, |
40 | | - TEAM_CONFIG, |
41 | | - USER_CONFIG, |
42 | | -) |
| 27 | +from .profile_constants import BASE_PROFILE, GLOBAL_CONFIG_NAME, TEAM_CONFIG, USER_CONFIG |
43 | 28 |
|
44 | 29 | HAS_KEYRING = True |
45 | 30 |
|
@@ -272,7 +257,9 @@ def get_profile( |
272 | 257 | cfg_profile = Profile() |
273 | 258 | try: |
274 | 259 | cfg_profile = cfg.get_profile( |
275 | | - profile_name=profile_name, profile_type=profile_type, validate_schema=validate_schema |
| 260 | + profile_name=profile_name, |
| 261 | + profile_type=profile_type, |
| 262 | + validate_schema=validate_schema, |
276 | 263 | ) |
277 | 264 | except ValidationError as exc: |
278 | 265 | logger.error(f"Instance was invalid under the provided $schema property, {exc}") |
@@ -485,7 +472,12 @@ def get_highest_priority_layer(self, json_path: str) -> Optional[ConfigFile]: |
485 | 472 | """ |
486 | 473 | highest_layer = None |
487 | 474 | longest_match = "" |
488 | | - layers = [self.__project_user_config, self.__project_config, self.__global_user_config, self.__global_config] |
| 475 | + layers = [ |
| 476 | + self.__project_user_config, |
| 477 | + self.__project_config, |
| 478 | + self.__global_user_config, |
| 479 | + self.__global_config, |
| 480 | + ] |
489 | 481 |
|
490 | 482 | original_name = layers[0].get_profile_name_from_path(json_path) |
491 | 483 |
|
@@ -556,7 +548,12 @@ def set_profile(self, profile_path: str, profile_data: dict) -> None: |
556 | 548 |
|
557 | 549 | def save(self) -> None: |
558 | 550 | """Save the layers (configuration files) to disk.""" |
559 | | - layers = [self.__project_user_config, self.__project_config, self.__global_user_config, self.__global_config] |
| 551 | + layers = [ |
| 552 | + self.__project_user_config, |
| 553 | + self.__project_config, |
| 554 | + self.__global_user_config, |
| 555 | + self.__global_config, |
| 556 | + ] |
560 | 557 |
|
561 | 558 | for layer in layers: |
562 | 559 | layer.save(False) |
|
0 commit comments