Improve the check/all testing script#7962
Conversation
* 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
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
mhucka
left a comment
There was a problem hiding this comment.
Very minor comments. LGTM otherwise. Thanks for the improvements!
| -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) |
There was a problem hiding this comment.
Optional: it might be slightly more maintainable to put the options in alphabetical order.
There was a problem hiding this comment.
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>
And update the development doc with preferred `check/all` options. Follow-up to quantumlib#7962
And update the development doc with preferred `check/all` options. Follow-up to #7962
ruff checklinter check--fixto apply corrections from bothruffandblack--changedas a shorter alias for--only-changed-files-h, --helpto show usage inforef: Add check/all OpenFermion#1146
Follow-up to #7951