Skip to content

flake8 plugin which checks that a timeout is set to all requests and urllib.request.open calls

License

Notifications You must be signed in to change notification settings

jkittner/flake8-timeout

Repository files navigation

ci pre-commit.ci status

flake8-timeout

flake8 plugin which checks that a timeout is set in all requests and urllib.request.open calls.

  • For example: requests.post('https://example.com') or urllib.request.open('https://example.com') will trigger TIM100
  • requests.post('https://example.com', timeout=5) or urllib.request.open('https://example.com', timeout=5) is expected instead

installation

pip install flake8-timeout

flake8 code

Code Description
TIM100 timeout missing for request call

as a pre-commit hook

See pre-commit for instructions

Sample .pre-commit-config.yaml:

-   repo: https://github.com/pycqa/flake8
    rev: 4.0.1
    hooks:
    -   id: flake8
        additional_dependencies: [flake8-timeout==0.3.0]

About

flake8 plugin which checks that a timeout is set to all requests and urllib.request.open calls

Resources

License

Stars

Watchers

Forks

Languages