[red-knot] Allow any Ranged argument for report_lint and report_diagnostic#16252
Merged
MichaReiser merged 1 commit intomainfrom Feb 19, 2025
Merged
[red-knot] Allow any Ranged argument for report_lint and report_diagnostic#16252MichaReiser merged 1 commit intomainfrom
Ranged argument for report_lint and report_diagnostic#16252MichaReiser merged 1 commit intomainfrom
Conversation
a1751a8 to
25cce39
Compare
AlexWaygood
approved these changes
Feb 19, 2025
25cce39 to
66372f1
Compare
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restricting
report_lintandreport_diagnosticto only take ast nodes as arguments is too restrictive.E.g., we may want to highlight a comparision like
10 not in bbut there's no single node that represents just thenot in ...comparision.This PR relaxes the argument representing the range to accept any
Rangedtype.Test Plan
cargo test