[flake8-type-checking] Stabilize runtime-cast-value (TC006)#16637
[flake8-type-checking] Stabilize runtime-cast-value (TC006)#16637ntBre merged 2 commits intomicha/ruff-0.10from
flake8-type-checking] Stabilize runtime-cast-value (TC006)#16637Conversation
Summary -- Stabilizes TC006. The test was already in the right place. Test Plan -- No open issues or PRs. The last related [issue] was closed on 2025-02-09. [issue]: #16037
CodSpeed Performance ReportMerging #16637 will degrade performances by 4.6%Comparing Summary
Benchmarks breakdown
|
|
| code | total | + violation | - violation | + fix | - fix |
|---|---|---|---|---|---|
| TC006 | 840 | 840 | 0 | 0 | 0 |
Linter (preview)
✅ ecosystem check detected no linter changes.
|
I only spot-checked the ecosystem results here since there are 839 😅 The ones I saw looked like true positives. I'm just a bit confused about the +0 fixes since this should always be fixable, and none of the examples I checked had comments to make it unsafe. |
I think the fixes column has been broken for quite a while now, even in my original PRs for implementing TC006-008 back in November the ecosystem results showed no fixes. I never have personally experienced it showing anything other than +0 -0 fixes in any of my PRS since either. Perhaps the concise output formatting was changed at some point or a change to the supplied command line parameters meant that fixes are never part of the output. Maybe it would be more reliable to use a machine readable output format like json for |
It's a bit confusing :) The ecosystem check first matches diagnostics between runs and then computes how many new or no longer existing fixes there are. That means, fixes is a diff between existing diagnostics. It doesn't account for new diagnostics. You can expand the diagnostics and each one with a |
* main: (53 commits) [syntax-errors] Tuple unpacking in `for` statement iterator clause before Python 3.9 (#16558) Ruff v0.10 Release (#16708) Add new `noqa` specification to the docs (#16703) describe requires-python fallback in docs (#16704) [red-knot] handle cycles in MRO/bases resolution (#16693) [red-knot] Auto generate statement nodes (#16645) [`pylint`] Better inference for `str.strip` (`PLE310`) (#16671) [`pylint`] Improve `repeated-equality-comparison` fix to use a `set` when all elements are hashable (`PLR1714`) (#16685) [`pylint`/`pep8-naming`] Check `__new__` argument name in `bad-staticmethod-argument` and not `invalid-first-argument-name-for-class-method` (`PLW0211`/`N804`) (#16676) [`flake8-pyi`] Stabilize fix for `unused-private-type-var` (`PYI018`) (#16682) [`flake8-bandit`] Deprecate `suspicious-xmle-tree-usage` (`S320`) (#16680) [`flake8-simplify`] Avoid double negation in fixes (`SIM103`) (#16684) [`pyupgrade`]: Improve diagnostic range for `redundant-open-mode` (`UP015`) (#16672) Consider all `TYPE_CHECKING` symbols for type-checking blocks (#16669) [`pep8-naming`]: Ignore methods decorated with `@typing.override` (`invalid-argument-name`) (#16667) Stabilize FURB169 preview behavior (#16666) [`pylint`] Detect invalid default value type for `os.environ.get` (`PLW1508`) (#16674) [`flake8-pytest-style`] Allow for loops with empty bodies (`PT012`, `PT031`) (#16678) [`pyupgrade`]: Deprecate `non-pep604-isinstance` (`UP038`) (#16681) [`flake8-type-checking`] Stabilize `runtime-cast-value` (`TC006`) (#16637) ...
Summary
Stabilizes TC006. The test was already in the right place.
Test Plan
No open issues or PRs. The last related issue was closed on 2025-02-09.