A plugin for flake8 finding likely bugs when chaining dict.get calls
Project description
flake8-get-chaining plugin checks for chained dict.get calls and makes sure valid defaults are provided.
Installation
Install from pip with:
$ pip install flake8-get-chaining
It will then automatically be run as part of flake8; you can check it has been picked up with:
$ flake8 --version
5.0.4 (flake8-get-chaining: 0.1.0, mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes: 2.5.0) CPython 3.10.9 on Linux
List of warnings
DGC1001: Missing default argument when chaining dict.get
This warning is emitted when dict.get calls are chained, and no default was provided.
Example: my_dict.get("foo").get("bar")
DGC1002: Invalid default argument when chaining dict.get
This warning is emitted when dict.get calls are chained, and the default value is
invalid (i.e not a dict nor an identifier)
Example: my_dict.get("foo", "bar").get("baz")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_get_chaining-0.2.0.tar.gz.
File metadata
- Download URL: flake8_get_chaining-0.2.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dd896f0c77997fed4f14b1a25360c965e712a7bbe9ebaaccad1dbd5932eeaab
|
|
| MD5 |
f1969c8e20a8086d42934e1763881a78
|
|
| BLAKE2b-256 |
fb6501aeb7949e6f312e421383630e0cc3065292d88e06fd43675a50f5b50c0b
|
File details
Details for the file flake8_get_chaining-0.2.0-py3-none-any.whl.
File metadata
- Download URL: flake8_get_chaining-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d9a04d67a6437474cece7d126bee80175c259e6026e010a0821d424616ab59c
|
|
| MD5 |
0eaab79ee088aa26e45123ad823cdaa0
|
|
| BLAKE2b-256 |
eb5f83884170e88b50aa9a389ab30bea565961c03ea4b591697431aec2437819
|