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

Do not format code cells on save #2605

Merged
merged 2 commits into from
May 14, 2024
Merged

Do not format code cells on save #2605

merged 2 commits into from
May 14, 2024

Conversation

jonatanklosko
Copy link
Member

We introduced the on-save formatting very early on (#40), before we had in-editor formatting (#416). We decided to drop the on-save formatting, so the code stays as written by the user and they can format using the editor as needed.

A major issue with on-save formatting is that it may introduce undesired changes for cases like Ecto queries (see #1212). We may want to export a notebook in places where we don't have an associated runtime, and so we do the formatting by calling Code.format_string! directly. This is not ideal, because it's really the responsibility of the runtime. More importantly, we could introduce an API to respect package-specific formatting rules, but that will only work when formatting within runtime.

Copy link

github-actions bot commented May 14, 2024

Uffizzi Preview deployment-51699 was deleted.

@jonatanklosko jonatanklosko merged commit c0b85ac into main May 14, 2024
7 of 8 checks passed
@jonatanklosko jonatanklosko deleted the jk-formatting branch May 14, 2024 15:33
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.

2 participants