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

Avoid false-positives for parens-on-raise with future.exception() #10206

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

charliermarsh
Copy link
Member

Summary

As a heuristic, we now ignore function calls that "look like" method calls (e.g., future.exception()).

Closes #10205.

@charliermarsh charliermarsh enabled auto-merge (squash) March 3, 2024 00:22
@charliermarsh charliermarsh added the bug Something isn't working label Mar 3, 2024
@charliermarsh charliermarsh changed the title Avoid false-positives for parens-on-raise with futures.exception() Avoid false-positives for parens-on-raise with futures.exception() Mar 3, 2024
@charliermarsh charliermarsh merged commit ba7f678 into main Mar 3, 2024
17 checks passed
@charliermarsh charliermarsh deleted the charlie/future branch March 3, 2024 00:28
Copy link
Contributor

github-actions bot commented Mar 3, 2024

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -1 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

apache/airflow (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

- airflow/exceptions.py:238:22: RSE102 Unnecessary parentheses on raised exception

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RSE102 1 0 1 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -1 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)

apache/airflow (+0 -1 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- airflow/exceptions.py:238:22: RSE102 Unnecessary parentheses on raised exception

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
RSE102 1 0 1 0 0

@AlexWaygood AlexWaygood changed the title Avoid false-positives for parens-on-raise with futures.exception() Avoid false-positives for parens-on-raise with future.exception() Mar 6, 2024
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
…stral-sh#10206)

## Summary

As a heuristic, we now ignore function calls that "look like" method
calls (e.g., `future.exception()`).

Closes astral-sh#10205.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

futures.exception() is flagged as "unnecessary parens on exception"
1 participant