From 15aa64a37972fe528f378287357bb41af65e7dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20V=C3=A1gner?= Date: Thu, 7 Nov 2024 16:02:22 +0100 Subject: [PATCH] squash: use `key_to_option` function --- tmt/config/models/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tmt/config/models/__init__.py b/tmt/config/models/__init__.py index 6a1635216f..0db7b43327 100644 --- a/tmt/config/models/__init__.py +++ b/tmt/config/models/__init__.py @@ -1,13 +1,10 @@ from tmt._compat.pydantic import BaseModel, Extra - - -def create_alias(name: str) -> str: - return name.replace('_', '-') +from tmt.utils import key_to_option class BaseConfig(BaseModel): class Config: # Accept only keys with dashes instead of underscores - alias_generator = create_alias + alias_generator = key_to_option extra = Extra.forbid validate_assignment = True