pandas-dev-flaker
Plugin for flake8 used to contribute to pandas.
NOTE: this is not a linter meant for pandas usage, but for pandas development. If you want a linter for pandas usage, please see pandas-vet.
installation
pip install pandas-dev-flaker
flake8 codes
| Code | Description |
|---|---|
| PDF001 | found import from 'collections.abc' (use 'from collections import abc') |
| PDF002 | builtin 'filter' function used |
| PDF003 | builtin 'exec' function used |
| PDF004 | 'foo.__class__' used, (use 'type(foo)' instead) |
| PDF005 | leading space in concatenated strings |
| PDF006 | Found '{foo!r}' formatted value (instead, use 'repr(foo)') |
| PDF007 | line split in two unnecessarily by 'black' formatter |
| PDF008 | found 'os.remove' (use 'tm.ensure_clean' instead) |
| PDF009 | 'pytest.raises' used without 'match=' |
| PDF010 | 'pytest.raises' used outside of context manager |
| PDF011 | found 'pytest.warns' (use 'pandas._testing.assert_produces_warning') |
| PDF012 | found 'pytest.xfail' (use 'pytest.mark.xfail' instead) |
| PDF013 | import from 'conftest' found |
| PDF014 | found import from 'pandas._testing' (use 'import pandas._testing as tm') |
| PDF015 | from import from 'pandas.testing' (use 'import pandas._testing as tm') |
| PDF016 | found 'unittest.mock' (use 'pytest.monkeypatch' instead) |
| PDF017 | 'pd.api.types' used (import from 'pandas.api.types' instead) |
| PDF018 | 'common' imported from 'pandas.core' without 'com' alias |
| PDF019 | found both 'pd.foo' and 'foo' in the same file |
| PDF020 | found private import across modules |
| PDF021 | found 'np.bool' or 'np.object' (use 'np.bool_' or 'np.object_' instead) |
| PDF022 | found import from 'numpy.random' |
| PDF023 | found assignment to single-letter variable |
| PDF024 | found string join() with generator expressions |
| PDF025 | found 'np.testing' or 'np.array_equal' (use 'pandas._testing' instead) |
| PDF026 | found union between Series and AnyArrayLike in type hint |
contributing
See contributing.md for how to get started.
Each new linting rule should be its own file inside pandas-dev-flaker/_plugins. Please linting rule should have two sets of tests in pandas-dev-flaker/tests - one for when the linting rule is expected to pass, and another for when it's expected to fail.
credit
Several methods are simplified versions of methods from pyupgrade. Some of the checks were taken from the pandas repo. Please find both their licenses in the LICENSES folder.
as a pre-commit hook
See pre-commit for instructions
Sample .pre-commit-config.yaml:
- repo: https://github.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8
additional_dependencies: [pandas-dev-flaker==0.5.0]
Release files for pandas-dev-flaker 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pandas_dev_flaker-0.5.0.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pandas_dev_flaker-0.5.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 35.9 kB
Release files / pandas_dev_flaker-0.5.0.tar.gz
| Download URL | pandas_dev_flaker-0.5.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e81a13693ada41d6f095598bc75c41f28e93043a495f2b6183f9847dc910aeb
|
|
BLAKE2b-256 checksum How to use checksums |
1d818009059c3f4dd1489c19e2ca4b53360174153663c381e2d6ffcb1c72facf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5
|
Release files / pandas_dev_flaker-0.5.0-py2.py3-none-any.whl
| Download URL | pandas_dev_flaker-0.5.0-py2.py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d1be89bf3718a35fe2de2a5df16bab3df1f5e798068a7dc081a74fd03306a7a3
|
|
BLAKE2b-256 checksum How to use checksums |
d7ca951ff7bfc4da37061c5dbcba063aa4da3d69c7e503190bbab548ed721eb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5
|