You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
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 thepath
parameter to the end of the parameter list, and then give it a default value ofNone
. Something like:Suggested change (Line 21):
Then, you can call
add_checks_to_list
with nopath
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.
The text was updated successfully, but these errors were encountered: