Skip to content

Commit

Permalink
Refactored validators into separate files (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
Onager authored Jun 7, 2024
1 parent e5e701d commit cdbcc3b
Show file tree
Hide file tree
Showing 26 changed files with 1,290 additions and 1,101 deletions.
8 changes: 6 additions & 2 deletions dftimewolf/cli/dftimewolf_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
import uuid

from typing import TYPE_CHECKING, List, Optional, Dict, Any, cast

from dftimewolf.lib.validators import manager as validators_manager
from dftimewolf.cli.curses_display_manager import CursesDisplayManager
from dftimewolf.cli.curses_display_manager import CDMStringIOWrapper

# The following import makes sure validators are registered.
from dftimewolf.lib import validators # pylint: disable=unused-import

# pylint: disable=wrong-import-position
from dftimewolf.lib import args_validator
from dftimewolf.lib import logging_utils
from dftimewolf.lib import telemetry
from dftimewolf import config
Expand Down Expand Up @@ -326,7 +330,7 @@ def ValidateArguments(self) -> None:
if argument_mandatory or argument_set:
argument_value = self.state.command_line_options[switch]
try:
valid_value = args_validator.ValidatorsManager.Validate(
valid_value = validators_manager.ValidatorsManager.Validate(
str(argument_value), arg)
self.state.command_line_options[switch] = valid_value
except errors.RecipeArgsValidationFailure as exception:
Expand Down
Loading

0 comments on commit cdbcc3b

Please sign in to comment.