flake8 plugin which checks that a timeout is set in all requests
and urllib.request.open
calls.
- For example:
requests.post('https://example.com')
orurllib.request.open('https://example.com')
will triggerTIM100
requests.post('https://example.com', timeout=5)
orurllib.request.open('https://example.com', timeout=5)
is expected instead
pip install flake8-timeout
Code | Description |
---|---|
TIM100 | timeout missing for request call |
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]