Skip to content

Preserve whitespace when replacing super tables#534

Merged
frostming merged 1 commit into
python-poetry:masterfrom
gaoflow:fix-352-super-table-whitespace
Jul 13, 2026
Merged

Preserve whitespace when replacing super tables#534
frostming merged 1 commit into
python-poetry:masterfrom
gaoflow:fix-352-super-table-whitespace

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #352.

Summary

  • treat nested table whitespace as table-ending whitespace when deciding whether to add cosmetic blank lines
  • add a regression test for reassigning a parsed super table without changing output

Verification

  • uv run --no-project --with pytest --with pyyaml python -m pytest tests/test_toml_document.py::test_replace_super_table_preserves_whitespace -q
  • uv run --no-project --with pytest --with pyyaml python -m pytest tests/test_toml_document.py -q
  • uv run --no-project --with pytest --with pyyaml python -m pytest -q
  • uv run --no-project --with ruff ruff check tomlkit/container.py tests/test_toml_document.py
  • uv run --no-project --with ruff ruff format --check tomlkit/container.py tests/test_toml_document.py
  • python -m compileall tomlkit/container.py tests/test_toml_document.py
  • git diff --check

@frostming frostming merged commit b282137 into python-poetry:master Jul 13, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rewrite new toml-data will has a new whitespace line

2 participants