Skip to content

Commit

Permalink
- Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
elipe17 committed Dec 18, 2024
1 parent 91c01e3 commit 7eea8d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tdrs-backend/tdpservice/parsers/validators/category1.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ def calendarQuarterIsValid(start=0, end=None):


# file pre-check validators
## TODO: the validators below are called explicitly with the ability to generate an error. They need a different method
## to deprecate themselves if we ever choose to.
# TODO: the validators below are called explicitly with the ability to generate an error. They need a different method
# to deprecate themselves if we ever choose to.
def validate_tribe_fips_program_agree(program_type, tribe_code, state_fips_code, generate_error):
"""Validate tribe code, fips code, and program type all agree with eachother."""
is_valid = False
Expand Down
6 changes: 3 additions & 3 deletions tdrs-backend/tdpservice/parsers/validators/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ def validator(value, eargs):

def deprecate_validator(validator):
"""
Decorator which deprecates an entire validator function.
Deprecate entire validator function.
This decorator should ONLY be used on validator functions that return an instance of 'make_validator'.
"""
def wrapper(*args, **kwargs):
wrapper_args = args
wrapper_kwargs = kwargs

def deprecated_validator(*args, **kwargs):
make_val = validator(*wrapper_args, **wrapper_kwargs)
is_valid, error, _ = make_val(*args, **kwargs)
Expand All @@ -47,8 +48,7 @@ def deprecated_validator(*args, **kwargs):


def deprecate_call(validator):
"""
Function that deprecates a top level, evaluated validator.
"""Deprecate top level, evaluated validator.
This function should wrap invocations of validators in a schema. E.g.:
`deprecate_call(category1.recordHasLengthBetween(117, 156))`.
Expand Down

0 comments on commit 7eea8d9

Please sign in to comment.