Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mypy(config[snapshot]): Add override for property/field conflicts
why:
- Snapshot classes have properties that conflict with dataclass field names during type checking
- These property/field collisions cause mypy to generate false positive error messages
- We need to silence these specific errors without compromising overall type safety

what:
- Added [[tool.mypy.overrides]] section in pyproject.toml for libtmux.snapshot module
- Set disable_error_code = ["override"] to silence property override errors
- Placed the override in a module-specific section to limit scope and prevent disabling
  this error check for other modules

refs: Complements the snapshot class refactoring to ensure clean mypy checks
  • Loading branch information
tony committed Apr 6, 2025
commit 73dea59dc84ed743abef6d72c6992b72db6f5464
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ disable_error_code = ["method-assign"]
module = "libtmux._internal.frozen_dataclass_sealable"
disable_error_code = ["method-assign"]

[[tool.mypy.overrides]]
module = "libtmux.snapshot"
disable_error_code = ["override"]

[[tool.mypy.overrides]]
module = "tests._internal.test_frozen_dataclass_sealable"
ignore_errors = true
Expand Down