Skip to content

Commit

Permalink
fix.lint.U013 incomplete message
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Jul 10, 2024
1 parent 29d26cf commit ff7d7a6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions cylc/flow/scripts/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,21 @@ def check_for_deprecated_environment_variables(
return False


def check_for_obsolete_environment_variables(line: str) -> List[str]:
def check_for_obsolete_environment_variables(line: str) -> Dict[str, List]:
"""Warn that environment variables are obsolete.
Examples:
>>> this = check_for_obsolete_environment_variables
>>> this('CYLC_SUITE_DEF_PATH')
['CYLC_SUITE_DEF_PATH']
>>> this('script = echo $CYLC_SUITE_DEF_PATH')
{'vars': ['CYLC_SUITE_DEF_PATH']}
>>> this('script = echo "irrelevent"')
{}
"""
return [i for i in OBSOLETE_ENV_VARS if i in line]
vars_found = [i for i in OBSOLETE_ENV_VARS if i in line]
if vars_found:
return {'vars': vars_found}
return {}


def check_for_deprecated_task_event_template_vars(
Expand Down

0 comments on commit ff7d7a6

Please sign in to comment.