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

Support formatter options #2702

Open
jonatanklosko opened this issue Jul 5, 2024 · 2 comments
Open

Support formatter options #2702

jonatanklosko opened this issue Jul 5, 2024 · 2 comments
Labels
discussion Needs to be discussed before moving forward

Comments

@jonatanklosko
Copy link
Member

jonatanklosko commented Jul 5, 2024

Currently Livebook formats the code without respecting any plugins or formatter options. We could add Kino.formatter_options(...) with options matching .formatter.exs. The logic would be similar to the mix format task. In order to handle :import_deps, we would need to traverse the dependencies and read their .formatter.exs. There is no public API to do this for the Mix.install/1 project, but we could possibly make Mix.in_install_dir/1 public in Elixir.

For now this issue is mostly to track interest and use cases.

Also see prior discussion in #1212.

@jonatanklosko jonatanklosko added the discussion Needs to be discussed before moving forward label Jul 5, 2024
@jonatanklosko jonatanklosko transferred this issue from livebook-dev/kino Jul 5, 2024
@zachallaun
Copy link
Contributor

zachallaun commented Jul 6, 2024

I'd like and would use this. Especially useful for libraries with macros usually used without parens that want to write documentation with Livebook. (Edit: I see this is the primary consideration talked about in the linked past discussion was well 😄)

@LostKobrakai
Copy link

I was the trigger for this issue over on slack a few days ago. I've been running into this with heex for building svg visualization in livebook, where the elixir code would format, but the heex markup wouldn't. Especially with tools like phoenix_playground components might become something more people build in livebook as well, even though this wasn't my usecase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Needs to be discussed before moving forward
Projects
None yet
Development

No branches or pull requests

3 participants