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 code formatting using ruff format #546

Closed
pavelzw opened this issue Jan 13, 2024 · 1 comment · Fixed by #1118
Closed

Support code formatting using ruff format #546

pavelzw opened this issue Jan 13, 2024 · 1 comment · Fixed by #1118

Comments

@pavelzw
Copy link
Contributor

pavelzw commented Jan 13, 2024

Description

It would be nice to be able to use ruff format instead of black. It's designed as a faster drop-in replacement for black, see https://docs.astral.sh/ruff/formatter/

Suggested solution

Check if ruff is installed and if so, use ruff format instead of black.

@baggiponte
Copy link
Contributor

I thought of that too but I think the problem is that ruff does not offer a Python API while black does. @akshayka what if marimo used black or ruff in the environment and installing black + isort would be optional (like marimo[format])? The only issue I see is that I mostly install ruff as a pre-commit hook or as an external dependency, but we could just configure the path in the configs. It could be an entrypoint to create an API to support plugins for formatting.

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 a pull request may close this issue.

2 participants