Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[red-knot] Refactor infer_chained_boolean_types to have access to TypeInferenceBuilder #16222

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

MichaReiser
Copy link
Member

Summary

This is a small refactor to align the signature of the binary and boolean comparison infer_ methods
closer to the signature of all other infer methods by making them instance methods on TypeInferenceBuilder.

Having access to the TypeInferenceBuilder allows us to e.g. emit diagnostics during type inference.

Test Plan

cargo test

@MichaReiser MichaReiser added the red-knot Multi-file analysis & type inference label Feb 18, 2025
@MichaReiser MichaReiser merged commit e84985e into main Feb 19, 2025
21 checks passed
@MichaReiser MichaReiser deleted the micha/infer-chained-boolean-types branch February 19, 2025 10:13
dcreager added a commit that referenced this pull request Feb 19, 2025
* main:
  [red-knot] Allow any `Ranged` argument for `report_lint` and `report_diagnostic` (#16252)
  [pycodestyle] Exempt `site.addsitedir(...)` calls (E402) (#16251)
  red_knot_python_semantic: improve diagnostic message for "invalid argument type"
  ruff_db: add "secondary" messages to `Diagnostic` trait
  ruff_db: refactor snippet rendering
  red_knot_python_semantic: remove `Ranged` impl for `TypeCheckDiagnostic`
  [red-knot] Refactor `infer_chained_boolean_types` to have access to `TypeInferenceBuilder` (#16222)
  Add `red_knot/README.md` (#16230)
  [airflow] move class attributed related cases to AIR302_class_attribute (AIR302) (#16226)
  [red-knot] Update tests for attributes inferred from parameters (#16208)
  [red-knot] update TODO comment in mdtest (#16242)
  [`refurb`] Correctly handle lengths of literal strings in `slice-to-remove-prefix-or-suffix` (`FURB188`) (#16237)
  Pass `ast::PythonVersion` to `type_hint_resolves_to_any` (#16236)
  Use `ast::PythonVersion` internally in the formatter and linter (#16170)
  Add `SECURITY.md` (#16224)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants