Skip to content
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

Requested Changes for reformat_yaml_data and add_check_to_list #67

Open
Jacob-Allebach opened this issue May 5, 2022 · 0 comments
Open
Assignees
Labels
input Requirement for Input team
Milestone

Comments

@Jacob-Allebach
Copy link
Contributor

From Pull Request #54

Lines 21 and 33:
To resolve the issue with sending None to this function explicitly, here's what you could do: move the path parameter to the end of the parameter list, and then give it a default value of None. Something like:

Suggested change (Line 21):

- def add_checks_to_list(path, data_list, reformatted_data):
+ def add_checks_to_list(data_list, reformatted_data, path=None):

Then, you can call add_checks_to_list with no path parameter to specify starting at the root (this would replace where you're currently manually specifying None), or give it a path if you're starting an inner recursive call (where you're calling it inside this function).

(Note: Would also need to change line 33 to put the path at the end of the function call)

Lines 26-28 and 33-35:
To make this code look better after running black (i.e. not have the line splitting on the parameter list), you should place the comment above the if statement, instead of after it. This will result in cleaner-looking code!

Line 38:
Instead of modifying reformatted_data and passing it by reference to ensure the values are returned, you should directly create and return a new list in this function, rather than creating it in reformat_yaml_data. When processing the result of a recursive call, just use reformatted_data.extend to add on the recursively-generated checks to the current data.

@Jacob-Allebach Jacob-Allebach added the input Requirement for Input team label May 5, 2022
@Michionlion Michionlion added this to the Release 1.0 milestone Jul 13, 2022
@burgess01 burgess01 self-assigned this Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input Requirement for Input team
Projects
None yet
Development

No branches or pull requests

3 participants