Skip to content

[flake8-bandit] request-without-timeout should warn for requests.request#11548

Merged
charliermarsh merged 4 commits intoastral-sh:mainfrom
akshetpandey:patch-1
May 28, 2024
Merged

[flake8-bandit] request-without-timeout should warn for requests.request#11548
charliermarsh merged 4 commits intoastral-sh:mainfrom
akshetpandey:patch-1

Conversation

@akshetpandey
Copy link
Contributor

Summary

Update S113 to also warns for missing timeout on when calling requests.request

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label May 26, 2024
@charliermarsh
Copy link
Member

This seems reasonable though it's surprising that Bandit itself does not check this method.

@charliermarsh charliermarsh self-assigned this May 28, 2024
@github-actions
Copy link
Contributor

github-actions bot commented May 28, 2024

ruff-ecosystem results

Linter (stable)

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

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

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

+ docker_tests/test_docker_compose_quick_start.py:44:16: S113 Probable use of requests call without timeout

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

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

+ zerver/tests/test_internet.py:14:22: S113 Probable use of requests call without timeout
+ zerver/tests/test_internet.py:26:22: S113 Probable use of requests call without timeout

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
S113 3 3 0 0 0

Linter (preview)

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

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

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

+ docker_tests/test_docker_compose_quick_start.py:44:16: S113 Probable use of requests call without timeout

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

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

+ zerver/tests/test_internet.py:14:22: S113 Probable use of requests call without timeout
+ zerver/tests/test_internet.py:26:22: S113 Probable use of requests call without timeout

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
S113 3 3 0 0 0

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@charliermarsh charliermarsh changed the title S113 request-without-timeout should warn for requests.request without timeout [flake8-bandit] request-without-timeout should warn for requests.request May 28, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) May 28, 2024 16:29
@charliermarsh charliermarsh merged commit 4a30558 into astral-sh:main May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants