Skip to content

chore: pre-commit autoupdate - #470

Merged
blink1073 merged 6 commits into
mainfrom
pre-commit-autoupdate-4a6a981b
Aug 3, 2026
Merged

chore: pre-commit autoupdate#470
blink1073 merged 6 commits into
mainfrom
pre-commit-autoupdate-4a6a981b

Conversation

@calysto-bot

@calysto-bot calysto-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Updated packages

  • ruff-pre-commit: v0.15.22v0.16.0

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.61%. Comparing base (50c53cc) to head (8b220c8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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              
Files with missing lines Coverage Δ
metakernel/_metakernel.py 89.59% <100.00%> (-0.19%) ⬇️
metakernel/magic.py 95.76% <100.00%> (ø)
metakernel/magics/activity_magic.py 92.64% <100.00%> (+1.47%) ⬆️
metakernel/magics/connect_info_magic.py 100.00% <100.00%> (ø)
metakernel/magics/file_magic.py 73.33% <100.00%> (-2.43%) ⬇️
metakernel/magics/install_magic.py 96.66% <100.00%> (+0.11%) ⬆️
metakernel/magics/magic_magic.py 100.00% <100.00%> (ø)
metakernel/magics/pipe_magic.py 100.00% <ø> (ø)
metakernel/magics/processing_magic.py 100.00% <100.00%> (ø)
metakernel/magics/show_magic.py 100.00% <ø> (ø)
... and 2 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

blink1073 and others added 5 commits August 3, 2026 05:29
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
blink1073 enabled auto-merge (squash) August 3, 2026 18:34
@blink1073
blink1073 disabled auto-merge August 3, 2026 18:34
@blink1073
blink1073 merged commit b38f0e4 into main Aug 3, 2026
26 checks passed
@blink1073
blink1073 deleted the pre-commit-autoupdate-4a6a981b branch August 3, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant