language-formatters-pre-commit-hooks icon indicating copy to clipboard operation
language-formatters-pre-commit-hooks copied to clipboard

pretty-format-toml removes trailing comments in list

Open l0b0 opened this issue 1 year ago • 11 comments
trafficstars

When reformatting a list setting like

load-plugins = [
  "pylint.extensions.bad_builtin",
  # "pylint.extensions.docparams",
  "pylint.extensions.set_membership"
  # "pylint.extensions.typing"
]

, the first comment is retained, but the second one is removed. Both comments should be retained. Not sure whether this is an issue with TomlSort or this repo.

l0b0 avatar Dec 20 '23 01:12 l0b0

This looks like a duplicate of https://github.com/macisamuele/language-formatters-pre-commit-hooks/issues/161

maresb avatar Jan 20 '24 10:01 maresb

I feel like this TOML pre-commit hook needs a big red warning that it's unsafe since it will unceremoniously delete comments.

maresb avatar Jan 20 '24 16:01 maresb