Use more precise error ranges for names#1513
Merged
charliermarsh merged 1 commit intoastral-sh:mainfrom Dec 31, 2022
Merged
Conversation
renovate bot
referenced
this pull request
in ixm-one/pytest-cmake-presets
Dec 31, 2022
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ruff](https://togithub.com/charliermarsh/ruff) | `^0.0.204` -> `^0.0.205` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>charliermarsh/ruff</summary> ### [`v0.0.205`](https://togithub.com/charliermarsh/ruff/releases/tag/v0.0.205) [Compare Source](https://togithub.com/charliermarsh/ruff/compare/v0.0.204...v0.0.205) #### What's Changed - Avoid flagging nested f-strings by [@​charliermarsh](https://togithub.com/charliermarsh) in [https://github.com/charliermarsh/ruff/pull/1516](https://togithub.com/charliermarsh/ruff/pull/1516) - Use more precise error ranges for names by [@​harupy](https://togithub.com/harupy) in [https://github.com/charliermarsh/ruff/pull/1513](https://togithub.com/charliermarsh/ruff/pull/1513) **Full Changelog**: astral-sh/ruff@v0.0.204...v0.0.205 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43NC4yIiwidXBkYXRlZEluVmVyIjoiMzQuNzQuMiJ9--> Signed-off-by: Renovate Bot <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Contributor
|
What's the reasoning behind this range narrowing? The error is about using global, so I think including the |
Contributor
Author
|
@not-my-profile That makes sense. I'm happy to file a PR to revert the changes for PLW0602 and PLE0117. |
Contributor
Author
|
The range narrowing might make sense in the following case: def f():
global x, y, z
^^^^^^^^^^^^^^
x = y = 1vs. def f():
global x, y, z
^
x = y = 1 |
Contributor
|
Ah ok, yes that does make sense :) I assume ruff doesn't support multi-ranges? def f():
global x, y, z
^^^^^^ ^
x = y = 1Apparently |
Member
|
We don’t support multi-ranges right now. It could be useful but I’d need to think on it. It’s tricky because it doesn’t map well to the LSP schema. |
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.
Improves error ranges for the following rules:
Current
Fixed