Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable top-level docstring formatting for notebooks #9957

Merged
merged 3 commits into from
Feb 12, 2024

Conversation

MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Feb 12, 2024

Summary

one can't access the module docstring for a notebook which makes a notebook not having a module level docstring. @dhruv

This PR handles strings at the top of a cell as non-docstrings. Handling them as docstrings has the undesired result that one might have multiple "docstrings" in a single notebook,
which is probably not what you want.

We don't need to gate this behind preview because it doesn't change any formatted code.

Test Plan

Added tests

@MichaReiser MichaReiser added formatter Related to the formatter notebook Related to (Jupyter) notebooks bug Something isn't working labels Feb 12, 2024
@MichaReiser MichaReiser enabled auto-merge (squash) February 12, 2024 18:08
@MichaReiser MichaReiser merged commit edfe842 into main Feb 12, 2024
16 checks passed
@MichaReiser MichaReiser deleted the notebook-module-docstring branch February 12, 2024 18:14
Copy link
Contributor

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter Related to the formatter notebook Related to (Jupyter) notebooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants