Skip to content

Conversation

@henryiii
Copy link
Collaborator

@henryiii henryiii commented Nov 17, 2025

I was working on improving the ruff coverage, and found I could get rid of some Any, including the ones on the .run methods. I didn't finish working on Any, but stopped after I had an improvement.

This enables ALL ruff checks, and just disables the ones we don't want (a few have TODO's).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves type safety by refining type annotations for the .run() method and related functions, eliminating several instances of Any types. The PR also modernizes the ruff linting configuration by enabling all checks and explicitly disabling unwanted ones.

Key changes:

  • Added type overloads for session.run() to provide more precise return types based on the silent parameter
  • Changed ruff configuration from selective check enabling to enabling all checks with explicit ignores
  • Renamed shadowing variables (e.g., exit to mock_exit, locals to my_locals) to avoid conflicts with built-in names
  • Updated type: ignore comments from arg-type to call-overload to reflect the new overload signatures

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
nox/sessions.py Added typing overloads for run(), run_install(), and run_always() methods with more precise return types; added # noqa: BLE001 for broad exception catches
nox/virtualenv.py Added explicit -> None return type annotations to __init__ methods; added # noqa: BLE001 for broad exception handling
nox/manifest.py Renamed locals variable to my_locals to avoid shadowing the built-in
nox/logger.py Added explicit -> None return type annotation to __init__ method
nox/_cli.py Improved type annotations by replacing Any with Namespace for function parameters
tests/test_sessions.py Updated type: ignore comments from arg-type to call-overload to match new overload signatures
tests/test_main.py Renamed exit mock variables to mock_exit to avoid shadowing the built-in
pyproject.toml Restructured ruff configuration to enable all checks with explicit ignores instead of selective enabling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@henryiii henryiii force-pushed the henryiii/chore/moreruff2 branch from 3ab2c89 to 3804cd5 Compare January 6, 2026 22:04
@henryiii henryiii force-pushed the henryiii/chore/moreruff2 branch from db8c9db to b54009f Compare January 6, 2026 22:40
@henryiii henryiii merged commit f8edf5f into wntrblm:main Jan 8, 2026
18 checks passed
@henryiii henryiii deleted the henryiii/chore/moreruff2 branch January 8, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant