Skip to content

Conversation

@charliermarsh
Copy link
Member

Summary

Closes #13862.

@charliermarsh charliermarsh changed the title Allow open without context manager in return statement Allow open without context manager in return statement Nov 3, 2024
@charliermarsh charliermarsh added the bug Something isn't working label Nov 3, 2024
@charliermarsh charliermarsh marked this pull request as ready for review November 3, 2024 19:01
@github-actions
Copy link
Contributor

github-actions bot commented Nov 3, 2024

ruff-ecosystem results

Linter (stable)

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

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

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

- airflow/utils/file.py:159:30: SIM115 Use a context manager for opening files
- airflow/utils/file.py:161:16: SIM115 Use a context manager for opening files
- dev/breeze/src/airflow_breeze/utils/console.py:86:16: SIM115 Use a context manager for opening files

bokeh/bokeh (+0 -2 violations, +0 -0 fixes)

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

- src/bokeh/settings.py:820:34: SIM115 Use a context manager for opening files
- src/bokeh/util/sampledata.py:158:12: SIM115 Use a context manager for opening files

pandas-dev/pandas (+0 -0 violations, +0 -0 fixes)


zulip/zulip (+4 -1 violations, +0 -0 fixes)

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

+ scripts/lib/zulip_tools.py:478:36: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
+ zerver/lib/test_helpers.py:267:65: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
+ zerver/lib/test_helpers.py:782:5: D415 First line should end with a period, question mark, or exclamation point
- zerver/lib/test_helpers.py:782:5: D415 First line should end with a period, question mark, or exclamation point
+ zerver/views/upload.py:267:82: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)

indico/indico (+1 -0 violations, +0 -0 fixes)

+ indico/core/storage/backend.py:231:61: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)

Changes by rule (3 rules affected)

code total + violation - violation + fix - fix
SIM115 5 0 5 0 0
RUF100 4 4 0 0 0
D415 2 1 1 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+5 -6 violations, +0 -0 fixes in 4 projects; 50 projects unchanged)

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

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

- airflow/utils/file.py:159:30: SIM115 Use a context manager for opening files
- airflow/utils/file.py:161:16: SIM115 Use a context manager for opening files
- dev/breeze/src/airflow_breeze/utils/console.py:86:16: SIM115 Use a context manager for opening files

bokeh/bokeh (+0 -2 violations, +0 -0 fixes)

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

- src/bokeh/settings.py:820:34: SIM115 Use a context manager for opening files
- src/bokeh/util/sampledata.py:158:12: SIM115 Use a context manager for opening files

zulip/zulip (+4 -1 violations, +0 -0 fixes)

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

+ scripts/lib/zulip_tools.py:478:36: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
+ zerver/lib/test_helpers.py:267:65: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)
+ zerver/lib/test_helpers.py:782:5: D400 First line should end with a period
- zerver/lib/test_helpers.py:782:5: D400 First line should end with a period
+ zerver/views/upload.py:267:82: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)

indico/indico (+1 -0 violations, +0 -0 fixes)

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

+ indico/core/storage/backend.py:231:61: RUF100 [*] Unused `noqa` directive (unused: `SIM115`)

Changes by rule (3 rules affected)

code total + violation - violation + fix - fix
SIM115 5 0 5 0 0
RUF100 4 4 0 0 0
D400 2 1 1 0 0

@charliermarsh charliermarsh merged commit 71a122f into main Nov 3, 2024
20 checks passed
@charliermarsh charliermarsh deleted the charlie/s branch November 3, 2024 19:16
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.

SIM115 false positive on functions that return file handler objects

2 participants