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
I'm not sure if this is a bug, so I checked the source code.
in file tomlkit/container.py, line 703 with function _replace_at , it will add a whitespace-line where there is not has whitespace-line.
how check ? the end of tomlkit/container.py
defends_with_whitespace(it: Any) ->bool:
"""Returns ``True`` if the given item ``it`` is a ``Table`` or ``AoT`` object ending with a ``Whitespace``. """return (
isinstance(it, Table) andisinstance(it.value._previous_item(), Whitespace)
) or (isinstance(it, AoT) andlen(it) >0andisinstance(it[-1], Whitespace))
ends_with_whitespace only check last and current without sub-tree.
Should subdata be checked ?
The text was updated successfully, but these errors were encountered:
rewrite toml data will has a new whitespace line.
eg toml:
toml
modified with rewrite new tool data, like this
the result (has a new line after
name = "x7"
)and if I edit in local with code
There will be no more line.
I'm not sure if this is a bug, so I checked the source code.
in file
tomlkit/container.py
, line 703 with function_replace_at
, it will add awhitespace-line
where there is not haswhitespace-line
.how check ? the end of
tomlkit/container.py
ends_with_whitespace
only check last and current without sub-tree.Should subdata be checked ?
The text was updated successfully, but these errors were encountered: