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

feat: format with ruff if provided, black is not #1118

Merged
merged 2 commits into from
Apr 12, 2024
Merged

Conversation

mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Apr 12, 2024

We still prefer black formatting, but if they have ruff we fallback to that before showing the warning.

Perf for each subprocess seems ok, but because we launch a new subprocess for each, I'd still prefer to use black

Fixes #546 , as long as the user removes black

Copy link

vercel bot commented Apr 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 0:59am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 0:59am

Comment on lines +58 to +59
formatted = process.stdout.decode()
formatted_codes[key] = formatted.strip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before doing this, check to make sure the process.returncode is 0 (ie success)

Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.3.13-dev12

Benni-Math pushed a commit to Benni-Math/marimo that referenced this pull request Apr 16, 2024
* feat: format with ruff if provided, black is not

* check return code
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.

Support code formatting using ruff format
2 participants