Skip to content

Improve the check/all testing script#7962

Merged
pavoljuhas merged 2 commits intoquantumlib:mainfrom
pavoljuhas:spruce-up-check-all
Mar 19, 2026
Merged

Improve the check/all testing script#7962
pavoljuhas merged 2 commits intoquantumlib:mainfrom
pavoljuhas:spruce-up-check-all

Conversation

@pavoljuhas
Copy link
Copy Markdown
Collaborator

@pavoljuhas pavoljuhas commented Mar 19, 2026

  • include the ruff check linter check
  • add option --fix to apply corrections from both ruff and black
  • add option --changed as a shorter alias for --only-changed-files
  • support -h, --help to show usage info
  • improve parsing of the BASE_REV revision argument
  • skip check/doctest in the only-changed-files mode to make it fast
  • rewrite in a similar way as in quantumlib/OpenFermion,
    ref: Add check/all OpenFermion#1146

Follow-up to #7951

* include the `ruff check` linter check

* add option `--fix` to apply corrections from both `ruff` and `black`

* add option `--changed` as a shorter alias for `--only-changed-files`

* support `-h, --help` to show usage info

* improve parsing of the BASE_REV revision argument

* skip check/doctest in the only-changed-files mode to make it fast

* rewrite in a similar way as in quantumlib/OpenFermion,
  ref: quantumlib/OpenFermion#1146

Follow-up to quantumlib#7951
@pavoljuhas pavoljuhas requested review from a team and vtomole as code owners March 19, 2026 02:31
@github-actions github-actions Bot added the size: M 50< lines changed <250 label Mar 19, 2026
@pavoljuhas pavoljuhas requested a review from mhucka March 19, 2026 02:31
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.63%. Comparing base (0c987fc) to head (7167998).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7962      +/-   ##
==========================================
- Coverage   99.63%   99.63%   -0.01%     
==========================================
  Files        1110     1110              
  Lines       99662    99662              
==========================================
- Hits        99296    99294       -2     
- Misses        366      368       +2     

☔ 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
Copy Markdown
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.

Very minor comments. LGTM otherwise. Thanks for the improvements!

Comment thread check/all
Comment thread check/all
Comment on lines +50 to +61
-h|--help)
echo "${usage}"
exit 0
;;
--changed|--only-changed-files)
only_changed=1
;;
--fix)
extra_format_args=( --apply )
extra_ruff_args=( --fix )
;;
--apply-format-changes)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optional: it might be slightly more maintainable to put the options in alphabetical order.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ack. I'd rather leave the order as is, because --apply-format-changes overlaps with --fix. I think that option is unnecessary, but we should leave it around for some time for developers who use it or have it in their scripts.

I will do a follow up PR with documentation update and a deprecation warning for that option.

Co-authored-by: Michael Hucka <mhucka@google.com>
@pavoljuhas pavoljuhas added this pull request to the merge queue Mar 19, 2026
Merged via the queue into quantumlib:main with commit b2a6af6 Mar 19, 2026
40 of 41 checks passed
@pavoljuhas pavoljuhas deleted the spruce-up-check-all branch March 19, 2026 23:33
pavoljuhas added a commit to pavoljuhas/Cirq that referenced this pull request Mar 20, 2026
And update the development doc with preferred `check/all` options.

Follow-up to quantumlib#7962
github-merge-queue Bot pushed a commit that referenced this pull request Mar 20, 2026
And update the development doc with preferred `check/all` options.

Follow-up to #7962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants