Closed DeviousStoat closed 5 months ago
Lint fails in CI on files I didn't touch and everything passes localy. Not sure what's going on. Maybe we can just try rerunning it?
Lint fails in CI on files I didn't touch and everything passes localy. Not sure what's going on. Maybe we can just try rerunning it?
Latest version of black made some changes to the formatting and required some flake8 ignores on certain rules. Rebase with develop
to get those changes and lint should be good.
fixes #213
The default type when setting a missing key is usually given by the
PathToken
built into_path_tokens
. However this function is incomplete and only builds a list ofPathToken
s if the path is a string.The issue here is that that line sets the default type to
list
if the object to update is not adict
. And as stated above, when we have a path as a listto_path_tokens
just returns the list and we don't have any information about the default factory, we just default tolist
. So when we create the first list and try to update it we expect an index.This PR updates the
to_path_tokens
function to be more general and build the list ofPathToken
even for a list.The added
pragma: no cover
are there because this case should now be impossible to reach, the only case where the tokens are notPathToken
s is when the path is only 1 non string value and we go directly to the end case as the for loop only iterates on the initial values.