Support human-readable names when hovering suppression comments and in code actions - #26114
Conversation
|
There was a problem hiding this comment.
This looks good. I'm inclined to rewrite hover to use the token stream instead of those fairly complicated regular expressions.
Codex also found two other pre-existing issues that I think are worth fixing (and migrating to a token based approach might give this for free).
"🚀" # ruff: ignore[F401]Hovering returns nothing, because the handler compares position.character with offset but position.character is UTF16, whereas `offset is in UTF8
The handler doesn't support redirects. This feels less urgent to fix
| let word = code_regex.find_iter(codes_match.as_str()).find(|code| { | ||
| cursor >= (code.start() + codes_start) && cursor < (code.end() + codes_start) | ||
| })?; | ||
| let identifiers_match = noqa_regex |
There was a problem hiding this comment.
Using a regex here feels a bit crazy 😆 It's unfortunate that we don't cache the AST in Ruff, but what if we parsed the module, used the token stream (there's a tokens.at_offset or similar method that gives you the tokens at offset). If that's a comment, split by # and then call into our noqa or ignore parsing (or do some manual text slicing).
There was a problem hiding this comment.
Yeah I was surprised to find a regex here too! And I guess I've now compounded the problem significantly... Do you want me to try the token approach here or as a follow-up?
There was a problem hiding this comment.
I went ahead and tried it here, including a commit caching the ParsedModule on TextDocument. I'm happy to revert one or both of those, or spin them off into a separate PR if you prefer, though.
The cache is a little bit annoying because, as Codex pointed out, the source type can change independently from the source code, so we have to track both and avoid the cache if the type changes. My understanding is that this requires editing Ruff configuration to change the extension mapping basically and should be quite rare but still possible.
Co-authored-by: Micha Reiser <micha@reiser.io>
| /// The language ID of the document as provided by the client. | ||
| language_id: Option<LanguageId>, | ||
| /// A lazily parsed module for hover requests. | ||
| parsed_module: OnceLock<Arc<ParsedModule>>, |
There was a problem hiding this comment.
I'm not sure it's worth caching ParsedModule. Hovers aren't that frequent and ruff's parser is really fast 1-2ms for most files. Caching also comes at a memory usage cost
There was a problem hiding this comment.
That makes sense. I reverted the caching commit and replaced it with a memchr check for # on the hovered line so that we can avoid parsing when there are no comments.
| source: &str, | ||
| comment_range: TextRange, | ||
| offset: TextSize, | ||
| ) -> Option<TextRange> { |
There was a problem hiding this comment.
Should this return the rule name (str) instead? Seems straightforward, given tha you have to source already
There was a problem hiding this comment.
We actually want both the identifier and its range for the hover code, so returning just the range is preferable to just the str. We could instead try to return a type with both, but the noqa and suppression comment paths currently have different types for this.
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 94.37%. The percentage of expected errors that received a diagnostic held steady at 89.00%. The number of fully passing files held steady at 94/134. |
| .tokens() | ||
| .at_offset(cursor) | ||
| .find(|token| token.kind() == TokenKind::Comment)?; | ||
| let identifier_range = |
There was a problem hiding this comment.
Do we need to verify whether the comment token/ identifier_range is within the requested range?
There was a problem hiding this comment.
I don't think so. All of the parser paths in rule_identifier_range_at_offset immediately construct a Cursor like:
let cursor = Cursor::new(&source[range]);and don't even retain a reference to the source otherwise, so I think that combined with Tokens::at_offset guarantees that any identifier we find is within the hover range.
And then we actually check again for offset here:
ruff/crates/ruff_linter/src/suppression.rs
Line 1286 in cdaa5f5
There was a problem hiding this comment.
I'm not sure about this but can't comment.range() be larger than the requested range. token_at gives you the token that starts, contains, or ends position.
There was a problem hiding this comment.
Sorry, I edited my comment. Maybe only the part in the edit about checking against the exact offset is actually relevant.
Memory usage reportMemory usage unchanged ✅ |
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-assignment |
3 | 230 | 5 |
unresolved-attribute |
33 | 121 | 30 |
invalid-argument-type |
12 | 6 | 4 |
unused-type-ignore-comment |
19 | 2 | 0 |
invalid-parameter-default |
0 | 5 | 0 |
not-iterable |
3 | 1 | 1 |
not-subscriptable |
3 | 0 | 0 |
unsupported-operator |
0 | 0 | 3 |
invalid-return-type |
0 | 1 | 1 |
no-matching-overload |
0 | 2 | 0 |
possibly-unresolved-reference |
2 | 0 | 0 |
unsupported-base |
0 | 1 | 0 |
| Total | 75 | 369 | 44 |
Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.
Showing a random sample of 297 of 488 changes. See the HTML report for the full diff.
Raw diff sample (297 of 488 changes)
aiohttp (https://github.com/aio-libs/aiohttp)
- aiohttp/test_utils.py:626:15 error[invalid-assignment] Object of type `MagicMock` is not assignable to `Application | None`
alerta (https://github.com/alerta/alerta)
- alerta/utils/api.py:139:39 error[not-iterable] Object of type `None` is not iterable
- tests/plugins/test_reject.py:27:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `get_config` of type `def get_config(key, default=None, type=None, **kwargs) -> Unknown`
apprise (https://github.com/caronc/apprise)
+ apprise/plugins/whatsapp.py:442:25 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: SupportsIndex, /) -> str, (index: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> tuple[str, ...]]` cannot be called with key of type `Literal["parameters"]` on object of type `tuple[str, str]`
+ apprise/plugins/whatsapp.py:442:25 error[invalid-argument-type] Method `__getitem__` of type `bound method dict[str, Unknown | str | bool | tuple[str, str]].__getitem__(key: str, /) -> Unknown | str | bool | tuple[str, str]` cannot be called with key of type `Literal[0]` on object of type `dict[str, Unknown | str | bool | tuple[str, str]]`
+ apprise/plugins/whatsapp.py:442:25 error[invalid-argument-type] Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["parameters"]` on object of type `str`
+ apprise/plugins/whatsapp.py:448:21 error[not-subscriptable] Cannot subscript object of type `bool` with no `__getitem__` method
+ apprise/plugins/whatsapp.py:448:21 error[invalid-argument-type] Method `__getitem__` of type `Overload[(index: SupportsIndex, /) -> str, (index: slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> tuple[str, ...]]` cannot be called with key of type `Literal["parameters"]` on object of type `tuple[str, str]`
+ apprise/plugins/whatsapp.py:448:21 error[invalid-argument-type] Method `__getitem__` of type `bound method dict[str, Unknown | str | bool | tuple[str, str]].__getitem__(key: str, /) -> Unknown | str | bool | tuple[str, str]` cannot be called with key of type `Literal[0]` on object of type `dict[str, Unknown | str | bool | tuple[str, str]]`
- tests/test_plugin_rocket_chat.py:424:5 error[unresolved-attribute] Unresolved attribute `return_value` on type `bound method NotifyRocketChat.login() -> Unknown`
- tests/test_utils_socket.py:391:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `connect` of type `def connect(self, *_args, **_kwargs) -> None`
- tests/test_utils_socket.py:498:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `send` of type `def send(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:605:5 error[unresolved-attribute] Object of type `bound method _DummySocket.bind(...) -> None` has no attribute `assert_called_once`
- tests/test_utils_socket.py:783:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `send` of type `def send(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:786:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `send` of type `def send(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:810:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:813:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:847:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:867:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:869:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:998:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
- tests/test_utils_socket.py:1027:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `recv` of type `def recv(self, *_args, **_kwargs) -> Unknown`
bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch/tests/test_sync.py:17:70 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:236:67 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:311:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:331:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:411:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:436:62 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:471:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:510:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_mirror.py:547:75 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_package.py:60:47 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ src/bandersnatch/tests/test_package.py:74:72 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
boostedblob (https://github.com/hauntsaninja/boostedblob)
- boostedblob/listing.py:402:14 error[unresolved-attribute] Object of type `Element[Unknown]` has no attribute `iterchildren`
+ boostedblob/listing.py:402:14 error[unresolved-attribute] Object of type `Element[str]` has no attribute `iterchildren`
cki-lib (https://gitlab.com/cki-project/cki-lib)
- tests/test_cronjob.py:38:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `run` of type `def run(self, *, last_run_datetime=None) -> Unknown`
- tests/test_cronjob.py:42:25 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:80:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `run` of type `def run(self, *, last_run_datetime=None) -> Unknown`
- tests/test_cronjob.py:85:25 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:86:9 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `assert_called_with`
- tests/test_cronjob.py:95:26 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:110:29 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:111:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `assert_called_with`
- tests/test_cronjob.py:115:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `reset_mock`
- tests/test_cronjob.py:118:29 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `called`
- tests/test_cronjob.py:119:13 error[unresolved-attribute] Object of type `bound method CronJob.run(*, last_run_datetime=None) -> Unknown` has no attribute `assert_called_with`
- tests/test_cronjob.py:140:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_run` of type `def _run(self, last_run_datetime) -> Unknown`
- tests/test_cronjob.py:184:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_run` of type `def _run(self, last_run_datetime) -> Unknown`
- tests/test_cronjob.py:246:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_run` of type `def _run(self, last_run_datetime) -> Unknown`
- tests/test_psql.py:98:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_execute` of type `def _execute(self, query, *args) -> Unknown`
- tests/test_psql.py:102:29 error[unresolved-attribute] Object of type `bound method PSQLHandler._execute(query, *args) -> Unknown` has no attribute `call_count`
cloud-init (https://github.com/canonical/cloud-init)
- cloudinit/sources/helpers/azure.py:518:32 error[unresolved-attribute] Attribute `text` is not defined on `None` in union `Element[Unknown] | None`
+ cloudinit/sources/helpers/azure.py:518:32 error[unresolved-attribute] Attribute `text` is not defined on `None` in union `Element[str] | None`
- tests/unittests/sources/test_azure.py:1262:13 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `get_tmp_exec_path` on type `(Unknown & ~str) | Distro`
- tests/unittests/test_stages.py:98:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_new_instance` of type `def is_new_instance(self) -> Unknown`
- tests/unittests/test_stages.py:569:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_new_instance` of type `def is_new_instance(self) -> Unknown`
colour (https://github.com/colour-science/colour)
- colour/notation/munsell/centore2014.py:329:12 error[invalid-return-type] Return type does not match returned value: expected `tuple[tuple[tuple[int | float, int | float], int | float], ...]`, found `tuple[tuple[Unknown, Unknown], ...] | tuple[tuple[tuple[Unknown, Unknown, Unknown], int | float], ...]`
+ colour/notation/munsell/centore2014.py:329:12 error[invalid-return-type] Return type does not match returned value: expected `tuple[tuple[tuple[int | float, int | float], int | float], ...]`, found `tuple[tuple[tuple[Unknown, Unknown, Unknown], int | float], ...]`
core (https://github.com/home-assistant/core)
- homeassistant/components/zha/__init__.py:271:11 error[unresolved-attribute] Attribute `async_initialize_devices_and_entities` is not defined on `None` in union `Unknown | None`
dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/vendor/ply/lex.py:331:23 error[unresolved-attribute] Unresolved attribute `type` on type `LexToken`
- ddtrace/vendor/ply/lex.py:319:40 error[not-iterable] Object of type `None | Unknown | list[Unknown] | list[tuple[Unknown, Unknown]]` may not be iterable
+ ddtrace/vendor/ply/lex.py:319:40 error[not-iterable] Object of type `None | Unknown | list[tuple[Unknown, Unknown]]` may not be iterable
- ddtrace/vendor/ply/yacc.py:3159:42 error[invalid-argument-type] Argument to function `getsourcefile` is incorrect: Expected `ModuleType | type[Any] | ((...) -> Any) | ... omitted 3 union elements`, found `Unknown | ModuleType | None`
+ ddtrace/vendor/ply/yacc.py:3159:42 error[invalid-argument-type] Argument to function `getsourcefile` is incorrect: Expected `ModuleType | type[Any] | ((...) -> Any) | ... omitted 3 union elements`, found `ModuleType | None`
- tests/appsec/appsec/api_security/test_api_security_manager.py:32:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_should_collect_schema` of type `def _should_collect_schema(self, env: ASM_Environment, priority: int | float) -> bool | None`
- tests/ci_visibility/test_ci_visibility.py:1827:13 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_is_gzip_supported_by_agent` of type `def _is_gzip_supported_by_agent(self) -> bool`
- tests/ci_visibility/test_ci_visibility.py:1845:13 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_is_gzip_supported_by_agent` of type `def _is_gzip_supported_by_agent(self) -> bool`
- tests/contrib/pytest/test_pytest_atr.py:338:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_atr.py:338:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
- tests/contrib/pytest/test_pytest_atr.py:339:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_atr.py:339:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
- tests/contrib/pytest/test_pytest_atr.py:340:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_atr.py:340:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
- tests/contrib/pytest/test_pytest_attempt_to_fix.py:259:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_attempt_to_fix.py:259:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
- tests/contrib/pytest/test_pytest_attempt_to_fix.py:272:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_attempt_to_fix.py:272:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
- tests/contrib/pytest/test_pytest_attempt_to_fix.py:273:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_attempt_to_fix.py:273:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
- tests/contrib/pytest/test_pytest_attempt_to_fix.py:274:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_attempt_to_fix.py:274:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
- tests/contrib/pytest/test_pytest_efd.py:518:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[Unknown] | None`
+ tests/contrib/pytest/test_pytest_efd.py:518:16 error[unresolved-attribute] Attribute `attrib` is not defined on `None` in union `Element[str] | None`
dragonchain (https://github.com/dragonchain/dragonchain)
- dragonchain/lib/dto/btc_utest.py:51:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/btc_utest.py:53:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/btc_utest.py:56:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/btc_utest.py:58:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/btc_utest.py:62:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `sign_transaction` of type `def sign_transaction(self, raw_transaction: dict[str, Any]) -> str`
- dragonchain/lib/dto/btc_utest.py:66:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:67:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork.sign_transaction(raw_transaction: dict[str, Any]) -> str` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:70:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_utxos` of type `def _get_utxos(self) -> list[Unknown]`
- dragonchain/lib/dto/btc_utest.py:77:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:87:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:90:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_calculate_transaction_fee` of type `def _calculate_transaction_fee(self) -> int`
- dragonchain/lib/dto/btc_utest.py:101:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:105:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:108:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:117:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:120:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:122:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:125:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:128:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/btc_utest.py:131:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:133:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_has_calls`
- dragonchain/lib/dto/btc_utest.py:138:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call` of type `def _call(self, method: str, *args: Any) -> Any`
- dragonchain/lib/dto/btc_utest.py:140:9 error[unresolved-attribute] Object of type `bound method BitcoinNetwork._call(method: str, *args: Any) -> Any` has no attribute `assert_called_once_with`
- dragonchain/job_processor/contract_job_utest.py:263:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:264:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:280:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `pull_image` of type `def pull_image(self, image_name: str) -> Unknown`
- dragonchain/job_processor/contract_job_utest.py:286:9 error[unresolved-attribute] Object of type `bound method ContractJob.pull_image(image_name: str) -> Unknown` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:307:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:308:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:312:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:330:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `set_state` of type `def set_state(self, state: str | ContractState, msg: str = "") -> None`
- dragonchain/job_processor/contract_job_utest.py:334:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:357:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:361:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:381:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:417:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `save` of type `def save(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:422:9 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called`
- dragonchain/job_processor/contract_job_utest.py:436:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `new_from_build_task` of type `def new_from_build_task(data: Mapping[str, Any]) -> SmartContractModel`
- dragonchain/job_processor/contract_job_utest.py:438:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create` of type `def create(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:445:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `new_from_build_task` of type `def new_from_build_task(data: Mapping[str, Any]) -> SmartContractModel`
- dragonchain/job_processor/contract_job_utest.py:455:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `deploy_to_openfaas` of type `def deploy_to_openfaas(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:469:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create_openfaas_secrets` of type `def create_openfaas_secrets(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:486:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `create_dockerfile` of type `def create_dockerfile(self) -> str`
- dragonchain/job_processor/contract_job_utest.py:488:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete_contract_image` of type `def delete_contract_image(self, image_digest: str) -> None`
- dragonchain/job_processor/contract_job_utest.py:491:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `schedule_contract` of type `def schedule_contract(self, action: SchedulerActions = SchedulerActions.CREATE) -> None`
- dragonchain/job_processor/contract_job_utest.py:510:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `delete_contract_data` of type `def delete_contract_data(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:512:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `unschedule_contract` of type `def unschedule_contract(self) -> None`
- dragonchain/job_processor/contract_job_utest.py:515:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_openfaas_secrets() -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:516:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_openfaas_function() -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:517:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_contract_image(image_digest: str) -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:518:9 error[unresolved-attribute] Object of type `bound method ContractJob.delete_contract_data() -> None` has no attribute `assert_called_once`
- dragonchain/job_processor/contract_job_utest.py:269:13 error[unresolved-attribute] Object of type `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` has no attribute `assert_called_once`
+ dragonchain/job_processor/contract_job_utest.py:269:13 error[unresolved-attribute] Attribute `assert_called_once` is not defined on `bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None` in union `(bound method SmartContractModel.set_state(state: str | ContractState, msg: str = "") -> None) | MagicMock`
- dragonchain/lib/database/redisearch_utest.py:78:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:87:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_called_once_with`
- dragonchain/lib/database/redisearch_utest.py:105:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_called_once_with`
- dragonchain/lib/database/redisearch_utest.py:118:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:124:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:135:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:152:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:162:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:175:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/lib/database/redisearch_utest.py:177:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_called_once_with`
- dragonchain/lib/database/redisearch_utest.py:193:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/database/redisearch_utest.py:194:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/database/redisearch_utest.py:195:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/database/redisearch_utest.py:197:9 error[unresolved-attribute] Function `_get_redisearch_index_client` has no attribute `assert_any_call`
- dragonchain/lib/dto/bnb_utest.py:73:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/bnb_utest.py:75:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:84:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_fetch_account` of type `def _fetch_account(self) -> Unknown`
- dragonchain/lib/dto/bnb_utest.py:97:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._fetch_account() -> Unknown` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:109:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_fetch_account` of type `def _fetch_account(self) -> Unknown`
- dragonchain/lib/dto/bnb_utest.py:119:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `sign_transaction` of type `def sign_transaction(self, raw_transaction: dict[str, Any]) -> str`
- dragonchain/lib/dto/bnb_utest.py:123:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:126:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:131:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:134:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:140:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:142:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:149:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:156:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:173:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:177:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:180:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/bnb_utest.py:186:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:187:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/bnb_utest.py:322:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:325:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:331:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:333:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:338:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_rpc` of type `def _call_node_rpc(self, method: str, params: dict[str, Any]) -> Any`
- dragonchain/lib/dto/bnb_utest.py:339:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_call_node_api` of type `def _call_node_api(self, path: str) -> Any`
- dragonchain/lib/dto/bnb_utest.py:341:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_rpc(method: str, params: dict[str, Any]) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/bnb_utest.py:342:9 error[unresolved-attribute] Object of type `bound method BinanceNetwork._call_node_api(path: str) -> Any` has no attribute `assert_called_once_with`
- dragonchain/lib/dto/eth_utest.py:51:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `sign_transaction` of type `def sign_transaction(self, raw_transaction: dict[str, Any]) -> str`
- dragonchain/lib/dto/eth_utest.py:88:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_calculate_transaction_fee` of type `def _calculate_transaction_fee(self) -> int`
- dragonchain/lib/dto/eth_utest.py:115:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/eth_utest.py:120:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/eth_utest.py:123:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/eth_utest.py:128:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/dto/eth_utest.py:131:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/lib/dto/eth_utest.py:136:9 error[unresolved-attribute] Object of type `bound method EthereumNetwork.get_current_block() -> int` has no attribute `assert_called_once`
- dragonchain/lib/interfaces/storage_utest.py:58:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:64:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_put` of type `def cache_put(key: str, value: str | bytes, cache_expire: int | None = None, service_name: str = "storage") -> bool`
- dragonchain/lib/interfaces/storage_utest.py:66:9 error[unresolved-attribute] Function `cache_get` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:70:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:78:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `put` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:100:9 error[unresolved-attribute] Object of type `(def list_objects(location: str, prefix: str) -> list[str]) | (def list_objects(location: str, prefix: str) -> list[str])` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:103:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:119:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `does_object_exist` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:123:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `put` of type `def put(key: str, value: bytes, cache_expire: int | None = None, should_cache: bool = True) -> None`
- dragonchain/lib/interfaces/storage_utest.py:125:9 error[unresolved-attribute] Function `put` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:130:9 error[unresolved-attribute] Function `get` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:133:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get` of type `def get(key: str, cache_expire: int | None = None, should_cache: bool = True) -> bytes`
- dragonchain/lib/interfaces/storage_utest.py:138:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` of type `def list_objects(prefix: str) -> list[str]`
- dragonchain/lib/interfaces/storage_utest.py:140:9 error[unresolved-attribute] Function `list_objects` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:143:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `list_objects` of type `def list_objects(prefix: str) -> list[str]`
- dragonchain/lib/interfaces/storage_utest.py:160:9 error[unresolved-attribute] Object of type `(def select_transaction(location: str, block_id: str, txn_id: str) -> dict[Unknown, Unknown]) | (def select_transaction(location: str, block_id: str, txn_id: str) -> dict[Unknown, Unknown])` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:164:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `cache_get` of type `def cache_get(key: str, service_name: str = "storage") -> bytes | None`
- dragonchain/lib/interfaces/storage_utest.py:166:9 error[unresolved-attribute] Function `cache_get` has no attribute `assert_called_once_with`
- dragonchain/lib/interfaces/storage_utest.py:169:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:174:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:178:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:183:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:187:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `select_transaction` on type `<module 'dragonchain.lib.interfaces.aws.s3'> | <module 'dragonchain.lib.interfaces.local.disk'>`
- dragonchain/lib/interfaces/storage_utest.py:194:9 error[unresolved-attribute] Function `put` has no attribute `assert_called_once_with`
- dragonchain/transaction_processor/level_5_actions_utest.py:239:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_current_block` of type `def get_current_block(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:244:9 error[unresolved-attribute] Object of type `bound method InterchainModel.publish_l5_hash_to_public_network(l5_block_hash: str) -> str` has no attribute `assert_called_once_with`
- dragonchain/transaction_processor/level_5_actions_utest.py:466:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `check_balance` of type `def check_balance(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:481:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `check_balance` of type `def check_balance(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:482:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:485:9 error[unresolved-attribute] Object of type `bound method InterchainModel.check_balance() -> int` has no attribute `assert_called_once`
- dragonchain/transaction_processor/level_5_actions_utest.py:493:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:496:9 error[unresolved-attribute] Object of type `bound method InterchainModel.get_transaction_fee_estimate() -> int` has no attribute `assert_called_once`
- dragonchain/transaction_processor/level_5_actions_utest.py:507:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:510:9 error[unresolved-attribute] Object of type `bound method InterchainModel.get_transaction_fee_estimate() -> int` has no attribute `assert_called_once`
- dragonchain/transaction_processor/level_5_actions_utest.py:519:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_transaction_fee_estimate` of type `def get_transaction_fee_estimate(self) -> int`
- dragonchain/transaction_processor/level_5_actions_utest.py:522:9 error[unresolved-attribute] Object of type `bound method InterchainModel.get_transaction_fee_estimate() -> int` has no attribute `assert_called_once`
- dragonchain/webserver/lib/verifications_dao_utest.py:120:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
- dragonchain/webserver/lib/verifications_dao_utest.py:132:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_redisearch_index_client` of type `def _get_redisearch_index_client(index: str) -> Unknown`
hydpy (https://github.com/hydpy-dev/hydpy)
+ hydpy/core/testtools.py:3131:5 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3131:27 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3131:38 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3131:49 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3132:5 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3132:15 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3133:5 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
+ hydpy/core/testtools.py:3133:15 error[unresolved-attribute] Unresolved attribute `model` on type `Device`
ibis (https://github.com/ibis-project/ibis)
+ ibis/backends/materialize/__init__.py:271:58 error[not-iterable] Object of type `Attribute` is not iterable
+ ibis/expr/types/temporal_windows.py:96:33 error[invalid-argument-type] Argument to function `unwrap_aliases` is incorrect: Expected `Iterator[Value]`, found `tuple[Value, ...]`
ignite (https://github.com/pytorch/ignite)
+ examples/reinforcement_learning/reinforce.py:95:9 error[unresolved-attribute] Unresolved attribute `observation` on type `State`
- tests/ignite/metrics/test_metric.py:827:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `compute` of type `def compute(self) -> Unknown`
mitmproxy (https://github.com/mitmproxy/mitmproxy)
- test/mitmproxy/tools/console/test_flowview.py:92:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_get_content_view` of type `_lru_cache_wrapper[tuple[str, list[Unknown]]]`
- test/mitmproxy/tools/console/test_flowview.py:94:5 error[unresolved-attribute] Object of type `_lru_cache_wrapper[tuple[str, list[Unknown]]]` has no attribute `assert_called_with`
mkdocs (https://github.com/mkdocs/mkdocs)
- mkdocs/tests/structure/file_tests.py:671:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_modified` of type `def is_modified(self) -> bool`
- mkdocs/tests/structure/file_tests.py:682:9 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `is_modified` of type `def is_modified(self) -> bool`
mypy (https://github.com/python/mypy)
- mypy/server/astmerge.py:316:46 error[invalid-argument-type] Argument to bound method `NodeReplaceVisitor.process_synthetic_type_info` is incorrect: Expected `TypeInfo`, found `Unknown | None | TypeInfo`
- mypy/build.py:3124:13 error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `Unknown | None | MypyFile` on object of type `dict[str, MypyFile]`
- mypy/build.py:3426:16 error[invalid-return-type] Return type does not match returned value: expected `TypeChecker`, found `Unknown | TypeChecker | None`
- mypy/semanal.py:6256:9 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `line` on type `Unknown | None | TypeApplication | TypeAliasExpr`
- mypy/semanal.py:6257:9 error[invalid-assignment] Object of type `Unknown` is not assignable to attribute `column` on type `Unknown | None | TypeApplication | TypeAliasExpr`
optuna (https://github.com/optuna/optuna)
- tests/study_tests/test_study.py:1707:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_all_trials` of type `def get_all_trials(self, study_id: int, deepcopy: bool = True, states: Container[TrialState] | None = None) -> list[FrozenTrial]`
pandas (https://github.com/pandas-dev/pandas)
- pandas/io/xml.py:516:26 error[unresolved-attribute] Attribute `find` is not defined on `None` in union `Element[Unknown] | Unknown | None`
+ pandas/io/xml.py:516:26 error[unresolved-attribute] Attribute `find` is not defined on `None` in union `Element[str] | Unknown | None`
- pandas/io/xml.py:600:17 error[unresolved-attribute] Attribute `xpath` is not defined on `Element[Unknown]`, `None` in union `Element[Unknown] | Unknown | None`
+ pandas/io/xml.py:600:17 error[unresolved-attribute] Attribute `xpath` is not defined on `Element[str]`, `None` in union `Element[str] | Unknown | None`
prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-aws/tests/test_glue_job.py:121:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_start_job` of type `def _start_job(self, client: Any) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:815:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:862:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:988:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1037:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1089:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1142:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1185:13 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1229:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1263:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:1812:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_retrieve_task_definition` of type `def _retrieve_task_definition(self, logger: Logger, ecs_client: Unknown, task_definition: str) -> Unknown`
- src/integrations/prefect-aws/tests/workers/test_ecs_worker.py:2370:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_create_task_run` of type `def _create_task_run(self, ecs_client: Unknown, task_run_request: dict[Unknown, Unknown]) -> str`
- src/integrations/prefect-dbt/tests/core/test_orchestrator_per_node.py:1373:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `_execute_per_node` of type `def _execute_per_node(self, waves, phases, largest_wave, full_refresh, macro_paths=None, freshness_results=None, all_nodes=None, adapter_type=None, project_name=None, target: str | None = None, extra_cli_args: list[str] | None = None, all_executable_nodes=None) -> Unknown`
+ src/prefect/cli/_server_utils.py:219:13 error[unresolved-attribute] Attribute `get_secret_value` is not defined on `None` in union `SecretStr | None`
+ src/prefect/tasks.py:571:35 error[invalid-assignment] Object of type `str | int | float | list[int | float] | None` is not assignable to `int | float | list[int | float] | ((int, /) -> list[int | float]) | None`
rotki (https://github.com/rotki/rotki)
+ rotkehlchen/tests/exchanges/test_bitfinex.py:600:51 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/tests/exchanges/test_bitfinex.py:1187:51 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/tests/exchanges/test_bitfinex.py:1479:51 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- rotkehlchen/tests/unit/test_tokens.py:203:51 error[unresolved-attribute] Function `find_main_currency_prices` has no attribute `call_args_list`
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py:912:5 error[invalid-assignment] Object of type `Mock` is not assignable to attribute `_raw_predict` of type `def _raw_predict(self, X, n_threads=None) -> Unknown`
+ sklearn/linear_model/_least_angle.py:692:17 warning[possibly-unresolved-reference] Name `C_idx` used when possibly not defined
+ sklearn/linear_model/_least_angle.py:742:21 warning[possibly-unresolved-reference] Name `C_idx` used when possibly not defined
- sklearn/tree/_classes.py:528:24 error[unresolved-attribute] Attribute `take` is not defined on `list[ndarray[tuple[Any, ...], dtype[Unknown]]]` in union `list[ndarray[tuple[Any, ...], dtype[Unknown]]] | ndarray[tuple[Any, ...], dtype[Unknown]] | Unknown`
+ sklearn/tree/_classes.py:528:24 error[unresolved-attribute] Attribute `take` is not defined on `list[ndarray[tuple[Any, ...], dtype[Unknown]]]` in union `list[ndarray[tuple[Any, ...], dtype[Unknown]]] | ndarray[tuple[Any, ...], dtype[Unknown]] | Any`
scrapy (https://github.com/scrapy/scrapy)
- tests/test_downloadermiddleware_redirect.py:421:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_spider_middleware` of type `def get_spider_middleware[_T](self, cls: type[_T]) -> _T | None`
- tests/test_downloadermiddleware_redirect.py:444:5 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `get_spider_middleware` of type `def get_spider_middleware[_T](self, cls: type[_T]) -> _T | None`
- tests/test_downloadermiddleware_robotstxt.py:225:20 error[unresolved-attribute] Object of type `bound method RobotsTxtMiddleware.process_request_2(rp: RobotParser | None, request: Request) -> None` has no attribute `called`
- tests/test_downloadermiddleware_robotstxt.py:230:20 error[unresolved-attribute] Object of type `bound method RobotsTxtMiddleware.process_request_2(rp: RobotParser | None, request: Request) -> None` has no attribute `called`
setuptools (https://github.com/pypa/setuptools)
- setuptools/_distutils/text_file.py:232:44 error[unsupported-operator] Operator `+` is not supported between objects of type `int | None | Unknown | Divergent` and `Literal[1]`
+ setuptools/_distutils/text_file.py:232:44 error[unsupported-operator] Operator `+` is not supported between objects of type `int | None | Unknown` and `Literal[1]`
spack (https://github.com/spack/spack)
- lib/spack/spack/test/conftest.py:1917:16 error[unresolved-attribute] Attribute `get` is not defined on `None` in union `Element[Unknown] | None`
+ lib/spack/spack/test/conftest.py:1917:16 error[unresolved-attribute] Attribute `get` is not defined on `None` in union `Element[str] | None`
spark (https://github.com/apache/spark)
+ python/pyspark/ml/classification.py:3722:33 error[invalid-argument-type] Argument to `JavaMLWriter.__init__` is incorrect: Expected `JavaMLWritable`, found `Self@write`
+ python/pyspark/ml/tests/test_algorithms.py:78:26 error[unresolved-attribute] Object of type `Classifier[Unknown]` has no attribute `getMaxIter`
+ python/pyspark/ml/tests/test_algorithms.py:79:26 error[unresolved-attribute] Object of type `Classifier[Unknown]` has no attribute `getMaxIter`
+ python/pyspark/ml/tests/test_algorithms.py:132:21 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `coefficients`
+ python/pyspark/ml/tests/test_algorithms.py:136:58 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `intercept`
+ python/pyspark/ml/tests/test_ovr.py:69:17 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `coefficients`
+ python/pyspark/ml/tests/test_ovr.py:73:13 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `coefficients`
+ python/pyspark/ml/tests/test_ovr.py:77:25 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `intercept`
+ python/pyspark/ml/tests/test_ovr.py:78:13 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `intercept`
+ python/pyspark/ml/tests/test_ovr.py:82:17 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `coefficients`
+ python/pyspark/ml/tests/test_ovr.py:86:13 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `coefficients`
+ python/pyspark/ml/tests/test_ovr.py:90:25 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `intercept`
+ python/pyspark/ml/tests/test_ovr.py:91:13 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `intercept`
+ python/pyspark/ml/tests/test_ovr.py:99:13 error[unresolved-attribute] Object of type `ClassificationModel` has no attribute `coefficients`
- python/pyspark/sql/tests/connect/client/test_client.py:691:17 error[unresolved-attribute] Attribute `operation_status` is not defined on `None` in union `Unknown | None | ExecutePlanRequest`
+ python/pyspark/sql/tests/connect/client/test_client.py:691:17 error[unresolved-attribute] Attribute `operation_status` is not defined on `None` in union `ExecutePlanRequest | None`
- python/pyspark/sql/tests/connect/client/test_client.py:725:9 error[unresolved-attribute] Attribute `operation_status` is not defined on `None` in union `Unknown | None | ExecutePlanRequest`
+ python/pyspark/sql/tests/connect/client/test_client.py:725:9 error[unresolved-attribute] Attribute `operation_status` is not defined on `None` in union `ExecutePlanRequest | None`
static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/index_hierarchy.py:3393:82 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
- static_frame/core/quilt.py:533:35 error[unresolved-attribute] Attribute `level_drop` is not defined on `None` in union `@Todo | IndexHierarchy | None`
- static_frame/core/quilt.py:537:17 error[invalid-assignment] Object of type `@Todo | IndexHierarchy | None` is not assignable to attribute `_index` of type `IndexBase`
- static_frame/core/quilt.py:546:17 error[invalid-assignment] Object of type `@Todo | IndexHierarchy | None` is not assignable to attribute `_columns` of type `IndexBase`
steam.py (https://github.com/Gobot1234/steam.py)
- steam/ext/commands/commands.py:782:17 error[invalid-argument-type] Argument to bound method `GroupMixin.remove_all_commands` is incorrect: Argument type `Command[CogT@GroupMixin, (...), Any] & GroupMixin[object]` does not satisfy upper bound `GroupMixin[CogT@GroupMixin]` of type variable `Self`
- steam/ext/commands/commands.py:284:29 error[invalid-argument-type] Argument to bound method `list.append` is incorrect: Expected `Self@parents`, found `Self@parents | (GroupMixin[Unknown] & Top[Command[Cog[Bot] | Bot | None, (...), object]])`
+ steam/ext/commands/commands.py:284:29 error[invalid-argument-type] Argument to bound method `list.append` is incorrect: Expected `Self@parents`, found `Self@parents | (GroupMixin[Cog[Bot] | Bot | None] & Top[Command[Cog[Bot] | Bot | None, (...), object]]) | (Group[Unknown, (...), Unknown] & Top[Command[Cog[Bot] | Bot | None, (...), object]])`
- steam/ext/commands/commands.py:826:11 error[invalid-assignment] Object of type `<class 'Command'>` is not assignable to `type[C@command]`
+ steam/ext/commands/commands.py:826:11 error[invalid-assignment] Object of type `(type[C@command] & ~AlwaysFalsy) | <class 'Command'>` is not assignable to `type[C@command]`
+ steam/gateway.py:683:17 error[invalid-assignment] Object of type `int` is not assignable to attribute `id64` of type `ID64`
- steam/gateway.py:782:9 error[invalid-assignment] Object of type `ID64` is not assignable to attribute `steam_id` on type `Unknown | MessageHeader | GCMessageHeader`
+ steam/gateway.py:782:9 error[invalid-assignment] Object of type `ID64` is not assignable to attribute `steam_id` on type `ProtobufMessageHeader | MessageHeader | GCMessageHeader`
- steam/gateway.py:783:9 error[invalid-assignment] Object of type `int` is not assignable to attribute `session_id` on type `Unknown | MessageHeader | GCMessageHeader`
+ steam/gateway.py:783:9 error[invalid-assignment] Object of type `int` is not assignable to attribute `session_id` on type `ProtobufMessageHeader | MessageHeader | GCMessageHeader`
- steam/protobufs/msg.py:97:32 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `EMsg`
- steam/protobufs/msg.py:145:32 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `EMsg`
- steam/protobufs/msg.py:224:46 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `EMsg`
- steam/protobufs/msg.py:309:9 error[invalid-parameter-default] Default value of type `MissingSentinel` is not assignable to annotated parameter type `AppID`
sympy (https://github.com/sympy/sympy)
- sympy/core/function.py:451:49 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
urllib3 (https://github.com/urllib3/urllib3)
- test/test_http2_connection.py:93:9 error[invalid-assignment] Object of type `MagicMock` is not assignable to attribute `putheader` of type `def putheader(self, header: str | bytes, *values: str | bytes) -> None`
vision (https://github.com/pytorch/vision)
- test/datasets_utils.py:570:50 error[invalid-argument-type] Argument is incorrect: Expected `bool | None`, found `Mock`
- test/datasets_utils.py:570:50 error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Mock`
yarl (https://github.com/aio-libs/yarl)
+ yarl/_url.py:608:79 error[not-iterable] Object of type `None` is not iterable
Summary
This PR addresses the hover and code action parts of #26058 (review), as well as adding hover support for
ruff:ignore-style comments in general, which previously did not support hovering likenoqacomments.I went back and forth on whether to split the two commits into two PRs, but they seemed interrelated enough to leave together.
Test Plan
New e2e tests and manual testing in VS Code:
Screen.Recording.2026-06-17.at.17.07.21.mov
You'll probably notice a range issue like I did in this video. I fixed that in the third commit but just recorded a short follow up video instead of trying to redo the full video:
Updated range
Screen.Recording.2026-06-17.at.17.24.43.mov