Skip to content

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

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/future
Mar 3, 2024
Merged

Avoid false-positives for parens-on-raise with future.exception()#10206
charliermarsh merged 1 commit into
mainfrom
charlie/future

Conversation

@charliermarsh
Copy link
Copy Markdown
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
@charliermarsh charliermarsh deleted the charlie/future branch March 3, 2024 00:28
@github-actions
Copy link
Copy Markdown
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