Skip to content

[ty] Support overriding respect-type-ignore-comments#22615

Merged
MichaReiser merged 3 commits intomainfrom
micha/analysis-file-level-overrides
Jan 19, 2026
Merged

[ty] Support overriding respect-type-ignore-comments#22615
MichaReiser merged 3 commits intomainfrom
micha/analysis-file-level-overrides

Conversation

@MichaReiser
Copy link
Member

Summary

Adds support for overriding respect-type-ignore-comments in the overrides section.

Fixes astral-sh/ty#2530

Test Plan

Added CLI tests

@MichaReiser MichaReiser requested a review from carljm as a code owner January 16, 2026 11:07
@MichaReiser MichaReiser added the configuration Related to settings and configuration label Jan 16, 2026
@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label Jan 16, 2026
@MichaReiser MichaReiser added configuration Related to settings and configuration ty Multi-file analysis & type inference labels Jan 16, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 16, 2026

Typing conformance results

No changes detected ✅

Comment on lines +1611 to +1617
let mut merged_analysis = analysis.into_owned();

if let Some(global_analysis) = global_analysis {
merged_analysis = merged_analysis.combine(global_analysis.clone());
}

let analysis = merged_analysis.to_settings();
Copy link
Member Author

Choose a reason for hiding this comment

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

When we start adding analysis options that can't be overriden (like a strict mode), we then have to warn here that this specific override setting was ignored OR define a separate OverrideAnalysisOptions that only defines the subset of options allowed in this section (so that editors don't provide completions for options that aren't allowed). However, this is something that we can figure out once we have non-overridable analysis options.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 16, 2026

mypy_primer results

Changes were detected when running on open source projects
static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/bus.py:675:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Bus[Any], object_]`, found `InterGetItemILocReduces[Self@iloc | Bus[Any], object_ | Self@iloc]`
+ static_frame/core/bus.py:671:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemLocReduces[Bus[Any], object_]`, found `InterGetItemLocReduces[Bus[Any] | Bottom[Series[Any, Any]] | ndarray[Never, Never] | ... omitted 6 union elements, object_]`
+ static_frame/core/bus.py:675:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Bus[Any], object_]`, found `InterGetItemILocReduces[Bus[Any] | ndarray[Never, Never] | TypeBlocks | ... omitted 6 union elements, object_ | Self@iloc]`
+ static_frame/core/series.py:772:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Series[Any, Any], TVDtype@Series]`, found `InterGetItemILocReduces[Series[Any, Any] | Bottom[Index[Any]] | TypeBlocks | ... omitted 6 union elements, TVDtype@Series]`
+ static_frame/core/series.py:4072:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[SeriesHE[Any, Any], TVDtype@SeriesHE]`, found `InterGetItemILocReduces[Bottom[Series[Any, Any]] | ndarray[Never, Never] | TypeBlocks | ... omitted 7 union elements, TVDtype@SeriesHE]`
+ static_frame/core/yarn.py:418:16: error[invalid-return-type] Return type does not match returned value: expected `InterGetItemILocReduces[Yarn[Any], object_]`, found `InterGetItemILocReduces[Yarn[Any] | Bottom[Index[Any]] | TypeBlocks | ... omitted 6 union elements, object_]`
- Found 1821 diagnostics
+ Found 1825 diagnostics

No memory usage changes detected ✅

@AlexWaygood AlexWaygood removed their request for review January 16, 2026 11:12
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 16, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@AlexWaygood AlexWaygood changed the title [ty] Support overriding `respect-type-ignore-comments [ty] Support overriding respect-type-ignore-comments Jan 16, 2026
@MichaReiser MichaReiser enabled auto-merge (squash) January 19, 2026 08:04
@MichaReiser MichaReiser merged commit 65b7fc9 into main Jan 19, 2026
48 checks passed
@MichaReiser MichaReiser deleted the micha/analysis-file-level-overrides branch January 19, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Related to settings and configuration ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support respect-type-ignore-comments in file overrides

2 participants