Skip to content

docs: clarify comment spacing after the final import - #2717

Open
Y2XNishan wants to merge 1 commit into
PyCQA:mainfrom
Y2XNishan:docs-newline-comments-2009
Open

Y2XNishan wants to merge 1 commit into
PyCQA:mainfrom
Y2XNishan:docs-newline-comments-2009

Conversation

@Y2XNishan

Copy link
Copy Markdown

Closes #2009.

Clarify that lines_after_imports can add a blank line before a comment following the final import even when ensure_newline_before_comments is false. Add a verified example and a cross-link to lines_after_imports. Explain that isort’s Black profile does not run Black, and that running Black separately adds the blank line in this example.

Update both the options documentation and its generator. Sorting behavior is unchanged.

Validation

On Windows 11 with Python 3.13.5:

  • Verified the isort and Black example outputs.
  • Checked that the updated documentation section matches its generator.
  • Built Sphinx HTML with warnings treated as errors, with external font and intersphinx fetching disabled. Checked rendered examples and the cross-link.
  • Ran the repository cleanup and test scripts: 668 passed, 5 skipped.
  • Ruff lint and format checks passed.
  • git diff --check passed.

The standard documentation build encountered network/SSL errors fetching external fonts. The done.sh wrapper could not invoke nested Bash on this Windows setup, so its clean.sh and test.sh components were run explicitly through Git Bash. Unrelated pre-existing differences between the generated options page and its generator were left unchanged.

Codex assisted with the change and ran the checks reported above.

This branch has not been deployed

No deployments
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.

ensure_newline_before_comments is not respected

1 participant