Skip to content

ruff_python_formatter: move docstring handling to a submodule#8861

Merged
BurntSushi merged 2 commits intomainfrom
ag/fmt/move-docstring
Nov 27, 2023
Merged

ruff_python_formatter: move docstring handling to a submodule#8861
BurntSushi merged 2 commits intomainfrom
ag/fmt/move-docstring

Conversation

@BurntSushi
Copy link
Member

This turns string into a parent module with a docstring sub-module. I arranged things this way because there are parts of the string module that the docstring module wants to know about (such as a NormalizedString). The alternative I think would be to make docstring a sibling module and expose more of string's internals.

I think I overall like this change because it gives docstring handling a bit more room to breath. It has grown quite a bit with the addition of code snippet formatting.

This was suggested by @charliermarsh.

This will let us add sub-modules. In particular, the docstring handling
is getting big enough to be worth splitting into its own module for room
to breath.
@github-actions
Copy link
Contributor

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for following up!

@charliermarsh charliermarsh added the internal An internal refactor or improvement label Nov 27, 2023
@BurntSushi BurntSushi merged commit 33caa2a into main Nov 27, 2023
@BurntSushi BurntSushi deleted the ag/fmt/move-docstring branch November 27, 2023 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants