Skip to content

[Infra]: fix run_vtr_task lint error #1821

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

Merged
merged 1 commit into from
Aug 12, 2021
Merged

[Infra]: fix run_vtr_task lint error #1821

merged 1 commit into from
Aug 12, 2021

Conversation

sdamghan
Copy link
Member

@sdamghan sdamghan commented Aug 5, 2021

Signed-off-by: Seyed Alireza Damghani [email protected]

Description

specifying the common_task_prefix variable type while initializing it

Related Issue

Motivation and Context

fix CI error for python-format

How Has This Been Tested?

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@@ -227,7 +227,7 @@ def vtr_command_main(arg_list, prog=None):

config_files = [find_task_config_file(task_name) for task_name in task_names]
configs = []
common_task_prefix = None # common task prefix to shorten task names
common_task_prefix = "" # common task prefix to shorten task names
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this changes the functionality of the script. Shouldn't common_task_prefix be initialized to config.task_name instead of ""? And with that change, I think the if / else checking if common_task_prefix is None can be deleted (just always do the else).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the definition of common_task_prefix initializes by empty string needs to be outside of the for loop since the 'shorten_task_names' function uses this variable. By that, I mean the value of config.task_name is specified inside the loop so we can not initialize the common_task_prefix with the value of config.task_name outside of the loop. However, you are right about the if / else expression, the if expression should change to 'if not common_task_prefix' to follow the previous path. Sorry for this mistake

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct me if I am wrong

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right -- didn't read that carefully enough. Yes, I think the fix will work.

@vaughnbetz
Copy link
Contributor

@sdamghan : I think the script functionality is changed by this PR, but there is an alternative change that wouldn't change it (and should simplify the logic). Please take a look.

Signed-off-by: Seyed Alireza Damghani <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants