flake8 plugin which checks that a timeout is set to all requests and urllib.request.open calls
Project description
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')
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
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]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flake8_timeout-0.3.0.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for flake8_timeout-0.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d2783daef149d51ce6b3ad5eeb3a53ee2921cbcb076bde92ffbe88754401173 |
|
MD5 | 3868b13f4e3b8ebf0060a986daabad2d |
|
BLAKE2b-256 | 716132113eb7efb2920391ff9421e64a0c91eeaeb03041b179b774f452beba00 |