Skip to content

Conversation

nl0
Copy link
Member

@nl0 nl0 commented Sep 11, 2025

Format all the code under api/python with Ruff and enable the format checking CI job

Copy link

codecov bot commented Sep 11, 2025

Codecov Report

❌ Patch coverage is 89.42731% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.09%. Comparing base (59a29f0) to head (d511bea).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
api/python/quilt3/data_transfer.py 75.86% 7 Missing ⚠️
api/python/quilt3/formats.py 61.53% 5 Missing ⚠️
api/python/quilt3/packages.py 75.00% 4 Missing ⚠️
api/python/quilt3/session.py 42.85% 4 Missing ⚠️
api/python/quilt3/main.py 50.00% 2 Missing ⚠️
api/python/quilt3/util.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4541   +/-   ##
=======================================
  Coverage   39.09%   39.09%           
=======================================
  Files         852      852           
  Lines       36845    36844    -1     
  Branches     6016     6016           
=======================================
  Hits        14404    14404           
+ Misses      21211    21210    -1     
  Partials     1230     1230           
Flag Coverage Δ
api-python 91.67% <89.42%> (+0.01%) ⬆️
catalog 19.70% <ø> (ø)
lambda 92.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@sir-sigurd sir-sigurd left a comment

Choose a reason for hiding this comment

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

almost LGTM

@nl0 nl0 requested a review from sir-sigurd September 12, 2025 09:36
@nl0
Copy link
Member Author

nl0 commented Sep 12, 2025

@sir-sigurd wdyt about quotes? should we enforce double quotes or just preserve existing style?

@sir-sigurd
Copy link
Member

should we enforce double quotes

I think so, but probably it should be done in a separate PR because it's straightforward and basically needs no review

@nl0 nl0 marked this pull request as ready for review September 12, 2025 12:13
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements a comprehensive code formatting initiative using Ruff across the entire api/python directory of the Quilt repository. The changes standardize Python code style by applying consistent formatting rules including: proper indentation and line breaks, trailing commas in multi-line constructs, improved docstring formatting, better multi-line expression handling, and consistent whitespace usage.

Key technical changes include:

  • Configuration updates: Removed exclusion of auto-generated GraphQL client files from Ruff formatting in pyproject.toml and added automatic formatting to the GraphQL code generation process
  • CI workflow enhancements: Split the linting job into separate lint-quilt3 and format-quilt3 jobs to enable format checking specifically for the api/python directory
  • Selective formatting exclusions: Added # fmt: off directives to preserve original formatting in generated/vendored code files like base_client.py
  • Comprehensive formatting: Applied consistent formatting across 40+ Python files including core modules (api.py, packages.py, data_transfer.py), test files, and admin utilities

The changes follow Python PEP 8 guidelines and modern formatting conventions, improving code readability while maintaining identical functionality. The formatting rules ensure consistent style for multi-line constructs, string literals, function calls, and data structures. This establishes a foundation for automated code quality enforcement through CI checks, preventing future formatting inconsistencies and reducing style-related discussions in code reviews.

Confidence score: 5/5

  • This PR is extremely safe to merge with no functional risks whatsoever
  • Score reflects that all changes are purely cosmetic formatting improvements with zero impact on code behavior or functionality
  • No files require special attention as this is a standard code formatting initiative using an established tool

38 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

@nl0 nl0 requested a review from sir-sigurd September 12, 2025 12:22
@nl0 nl0 enabled auto-merge September 15, 2025 14:06
@nl0 nl0 added this pull request to the merge queue Sep 15, 2025
Merged via the queue into master with commit 504f90c Sep 15, 2025
40 of 41 checks passed
@nl0 nl0 deleted the format-quilt3 branch September 15, 2025 14:14
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.

2 participants