Get help from the marimo community

Updated 6 months ago

support ruff configuration in `pyproject.toml`? also option to choose b/w ruff and black

At a glance

The community member is having trouble getting their ruff configuration to work with the marimo project, as it seems to be defaulting to black formatter. They cannot easily remove black since it is a required dependency. The community members discuss the possibility of making ruff the default formatter over black, as ruff is becoming more widely used. One community member offers to make the contribution by switching the if statement, and another community member confirms that this should work with either ruff.toml or pyproject.toml. The community members also discuss adding additional checks and warnings to the code.

Useful resources
first, thanks for creating marimo, i'm having fun developing with it. however, i can't seem to get my ruff pyproject.toml config to work.

might be something with my setup defaulting to black? i can't easily remove black since i installed marimo with conda (through pixi) and black is set as a required dependency.

would be useful to be able to manually select between the two.
M
l
R
14 comments
we could flip it now that ruff is more widely used
it would be nice to avoid a configuration and default to what the user has.
@lucabaggi you have good opinions back the python community - thoughts on making ruff the default formatter over black
Would be super cool! You could also use ruff for linting (and use lints for ai powered features).
Ruff is also becoming an LSP so you would eventually use that for type checking, refactoring…
thanks for the response!
@Raia would you be interested in making the contribution?
it could either be easy (switching the if statement), but i am not sure if it will use your ruff.toml or pyproject.toml. is that something you can verify?
sure, I can try it out!
cloned, did editable install, and tested. switching the if statements seems to be enough! also uses pyproject.toml or ruff.toml
will come back to this later tonight since it might be good to do more than just switching the if statements. maybe add a try: import ruff like class BlackFormatter
or at least a warning like BlackFormatter's LOGGER.warning( "To enable code formatting, install black (pip install black)")
That sounds like a good idea - appreciate the help!
Add a reply
Sign up and join the conversation on Discord