chore: pre-commit autoupdate - #470
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #470 +/- ##
==========================================
+ Coverage 93.54% 93.61% +0.07%
==========================================
Files 51 51
Lines 2974 2960 -14
Branches 416 410 -6
==========================================
- Hits 2782 2771 -11
+ Misses 131 128 -3
Partials 61 61
🚀 New features to boost your workflow:
|
ruff 0.16.0 expanded its default-enabled rules from 59 to 413. Since this project's ruff config uses extend-select (which adds to the default set rather than replacing it), the expansion silently pulled in ~350 new rule categories (BLE001, TRY002, SIM117, etc.), causing 144+ new lint failures unrelated to the ruff-pre-commit version bump itself. Pin select = ["E4", "E7", "E9", "F"] to restore the old default baseline, per Astral's own migration guidance. Also ignore uv.lock, which can be created as a stray artifact when tooling other than Poetry is used against this repo.
Rather than reverting to ruff's pre-0.16 default rule set wholesale, triage each newly-enabled rule category individually: - Fixed a real test bug caught by PLW0129: test_history asserted a truthy string literal instead of checking hist_cache. - Fixed 5 unclosed file handles (SIM115) by using context managers. - Combined nested `with` statements (SIM117), simplified dict/list literals (C408), `in dict.keys()` (SIM118), double-negatives (SIM201), nested ifs (SIM102), and other mechanical simplifications (PIE790, SIM114, FURB167/188, PLR1711, SIM905, RET501, FLY002). - Replaced logging.Logger() with logging.getLogger() (LOG001). - Filled in two empty docstrings used as magic help text (D419). - Made an activity-log timestamp timezone-aware (DTZ002), noqa'd for UP017 since mypy is still pinned to python_version 3.10. - Fixed file-mode/shebang mismatches on two test files (EXE001/002). - Added noqa'd ASYNC230 exceptions for two Jupyter-protocol methods that must be async but only do tiny, infrequent blocking file I/O. - Added BLE001 and TRY002 to the project-wide ignore list: this is a kernel that must catch arbitrary exceptions from user/magic code and report them rather than crash, and it has no existing custom exception hierarchy to raise instead of bare Exception. All other newly-enabled default rules were already clean.
…lation
logging.getLogger(name) returns a shared logger from the logging
manager's registry, keyed by name. Since every MetaKernel instance
used the same name (".metakernel"), switching to getLogger() in the
previous commit caused kernel instances to share one logger and its
handlers list. tests/utils.py's get_log_text() reads
kernel.log.handlers[0], so once a second kernel instance appended its
own handler, handlers[0] became a stale handler from an earlier
kernel/test -- causing test_metakernel.py::test_magics to read empty
log text on CI (surfaced on the Windows job).
Revert to logging.Logger(), which gives each kernel its own isolated,
unregistered Logger instance as originally intended, and noqa LOG001
with an explanation instead.
The SIM115 fix in the previous commit turned two single-line open()
calls into with-blocks in activity_magic.py ("edit" mode) and
connect_info_magic.py (parsing an existing connection file). Neither
success path had a test before -- only the fallback branches were
exercised -- so codecov's per-patch coverage check flagged the new
lines as uncovered. Add a test for each.
blink1073
enabled auto-merge (squash)
August 3, 2026 18:34
blink1073
disabled auto-merge
August 3, 2026 18:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated packages
v0.15.22→v0.16.0