Skip to content

Fix isort invocation in format-incremental #7194

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

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

pavoljuhas
Copy link
Collaborator

  • Exclude __init__.py files from isort targets.
    Skip isort execution altogether if only __init__.py files changed.

  • Make files in cirq-google/cirq_google/cloud subject to formatting.
    They were already formatted by black.

Follow up to #7190, #7181

Fixes #4863

These files are already formatted by black.
Skip isort execution altogether if only `__init__.py` files changed.
@pavoljuhas pavoljuhas requested review from vtomole and a team as code owners March 27, 2025 02:39
@pavoljuhas pavoljuhas requested a review from maffoo March 27, 2025 02:39
@pavoljuhas
Copy link
Collaborator Author

Verified Format check passes and isort ignores __init__.py after d9d752c - https://github.com/quantumlib/Cirq/actions/runs/14097730322/job/39488117961?pr=7182

@pavoljuhas pavoljuhas requested a review from daxfohl March 27, 2025 02:51
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.14%. Comparing base (7c8f58f) to head (5124cdd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7194      +/-   ##
==========================================
- Coverage   98.14%   98.14%   -0.01%     
==========================================
  Files        1100     1100              
  Lines       96191    96191              
==========================================
- Hits        94407    94404       -3     
- Misses       1784     1787       +3     

☔ 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
Collaborator

@daxfohl daxfohl left a comment

Choose a reason for hiding this comment

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

Cool, thanks! I was wondering offline if it might be better to loop through all the files and call both isort and black on each of them one by one. That'd let us print out an aggregate metric at the end, as to how many files would be affected. But super low priority and there may be disadvantages to that approach too.

Anyway, this lgtm

@pavoljuhas pavoljuhas requested a review from mhucka March 27, 2025 17:32
Copy link
Contributor

@mhucka mhucka left a comment

Choose a reason for hiding this comment

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

Nice!

@mhucka mhucka added this pull request to the merge queue Mar 27, 2025
Merged via the queue into quantumlib:main with commit c3d315e Mar 27, 2025
39 checks passed
@pavoljuhas pavoljuhas deleted the fix-incremental-isort branch March 27, 2025 19:10
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
* format-incremental - include files in cirq-google/cirq_google/cloud

These files are already formatted by black.

* format-incremental - exclude `__init__.py` files from isort targets

Skip isort execution altogether if only `__init__.py` files changed.
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.

Add module import linter in codebase
3 participants