Skip to content

PYTHON-5890 Skip ruff in synchro when called from just test/run-tests#2889

Closed
blink1073 wants to merge 4 commits into
mongodb:masterfrom
blink1073:PYTHON-5890-skip-ruff-in-tests
Closed

PYTHON-5890 Skip ruff in synchro when called from just test/run-tests#2889
blink1073 wants to merge 4 commits into
mongodb:masterfrom
blink1073:PYTHON-5890-skip-ruff-in-tests

Conversation

@blink1073

@blink1073 blink1073 commented Jun 22, 2026

Copy link
Copy Markdown
Member

PYTHON-5890 (follow up)

Changes in this PR

Unrelated linting issues in async files should not block test runs. When synchro.py is invoked via just test or just run-tests, all ruff calls (pre-check on async sources, fix pass on generated files, format pass on generated files) are now skipped.

This is controlled by a SYNCHRO_SKIP_RUFF environment variable, set in the run-synchro justfile recipe. The pre-commit hook invokes synchro.py directly without that variable, so ruff continues to run during commits.

Test Plan

Existing synchro smoke test continues to pass. Manual verification: just test and just run-tests no longer abort due to ruff errors in async source files; git commit still runs ruff via the pre-commit hook.

Checklist

Checklist for Author

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

Unrelated linting issues in async files should not block test runs.
Ruff still runs during pre-commit (where the hook calls synchro.py
directly without SYNCHRO_SKIP_RUFF set).
@blink1073 blink1073 requested a review from a team as a code owner June 22, 2026 21:56
@blink1073 blink1073 requested a review from sleepyStick June 22, 2026 21:56
The CI stale-file check compares regenerated files against committed
ones. Skipping ruff in CI causes the regenerated files to differ from
the committed (ruff-formatted) files, failing the check. SYNCHRO_SKIP_RUFF
only applies locally where the stale-file check doesn't run.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blink1073

Copy link
Copy Markdown
Member Author

This isn't quite right. I think we'll need a different approach that uses the git status for this to work. I'll open a new PR to remove the justfile usage of synchro and open a different ticket for the test auto-sync.

@blink1073 blink1073 closed this Jun 23, 2026
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.

3 participants