-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cylc lint
U013/U015 missing info
#6214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a similar issue for
cylc-flow/cylc/flow/scripts/lint.py
Lines 679 to 694 in 75d144e
'U015': { | |
'short': ( | |
'Deprecated template variables.'), | |
'rst': ( | |
'The following template variables, mostly used in event handlers,' | |
'are deprecated, and should be replaced:' | |
+ ''.join([ | |
f'\n * ``{old}`` ⇒ {new}' | |
for old, new in DEPRECATED_STRING_TEMPLATES.items() | |
]) | |
), | |
'url': ( | |
'https://cylc.github.io/cylc-doc/stable/html/user-guide/' | |
'writing-workflows/runtime.html#task-event-template-variables' | |
), | |
FUNCTION: check_for_deprecated_task_event_template_vars, |
expired handlers = %(suite_uuid)s %(user@host)s
Re-drafted - I'm going to write an automated test for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is Separate - I have in my mind that at some point I'm going to refactor out those aspects of Cylc lint which are data rather than infrastructure.
This comment was marked as resolved.
This comment was marked as resolved.
@@ -673,7 +687,7 @@ def list_wrapper(line: str, check: Callable) -> Optional[Dict[str, str]]: | |||
}, | |||
'U015': { | |||
'short': ( | |||
'Deprecated template variables.'), | |||
'Deprecated template variables: {suggest}'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than have to rely on variable names matching here (suggest
in this case but vars
elsewhere), why not just make the check functions return a list of strings, and add the joined list to the end of the short
message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows us to insert multiple variables
msg = check_meta['short'].format(**check)
It's used by one check.
I've re-drafted this PR - I want to have a think about where I'm going with this....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Un drafted - I think that my long term goal is to have a better defined check API so that others can add them, but I think I want this fixed sooner, and will worry about that later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor suggestions
Lint: Testing for check function outputting values if check['short'] needs them Apply suggestions from code review
cylc lint
U013/U015 missing info
closes #6205
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.