Skip to content

Commit

Permalink
squash: use key_to_option function
Browse files Browse the repository at this point in the history
  • Loading branch information
therazix committed Nov 21, 2024
1 parent 782a1aa commit e7ef3ff
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tmt/config/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e7ef3ff

Please sign in to comment.