Skip to content

fix: follow ruff rules for formatting trailing space after imports/ functions#8086

Merged
dmadisetti merged 7 commits intomainfrom
dm/ruff-fix
Feb 5, 2026
Merged

fix: follow ruff rules for formatting trailing space after imports/ functions#8086
dmadisetti merged 7 commits intomainfrom
dm/ruff-fix

Conversation

@dmadisetti
Copy link
Collaborator

@dmadisetti dmadisetti commented Feb 1, 2026

📝 Summary

Ruff expects a new blank line after class defs, functions, and imports. Currently, we get rid of this extraneous spacing (and ruff doesn't detect it since we format without the return).

This pr introduces detection for the required spacing, with a little bit of extra logic to handle trailing comments.

closes #7526


Seems like we already handle the single trailing line case:

def _():
    import marimo
    
    return
image
def _():
    import marimo


    return
image

@vercel
Copy link

vercel bot commented Feb 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 3, 2026 0:32am

Request Review

@dmadisetti dmadisetti added the bug Something isn't working label Feb 1, 2026
@dmadisetti dmadisetti changed the title fix: follow ruff rules for formating fix: follow ruff rules for formatting trailing space after imports/ functions Feb 1, 2026
@dmadisetti dmadisetti requested a review from mscolnick February 2, 2026 19:39
mscolnick
mscolnick previously approved these changes Feb 2, 2026
@dmadisetti dmadisetti merged commit a8b38cc into main Feb 5, 2026
44 of 49 checks passed
@dmadisetti dmadisetti deleted the dm/ruff-fix branch February 5, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import cell line fighting between Marimo and Ruff

2 participants