Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

flake8 plugin used for pandas development

License

NotificationsYou must be signed in to change notification settings

pandas-dev/pandas-dev-flaker

Repository files navigation

Build StatusCoverage

pandas-dev-flaker

Plugin forflake8 used to contribute topandas.

NOTE: this is not a linter meant for pandas usage, but for pandas development. If you wanta linter for pandas usage, please seepandas-vet.

installation

pip install pandas-dev-flaker

flake8 codes

CodeDescription
PDF001found import from 'collections.abc' (use 'from collections import abc')
PDF002builtin 'filter' function used
PDF003builtin 'exec' function used
PDF004'foo.__class__' used, (use 'type(foo)' instead)
PDF005leading space in concatenated strings
PDF006Found '{foo!r}' formatted value (instead, use 'repr(foo)')
PDF007line split in two unnecessarily by 'black' formatter
PDF008found 'os.remove' (use 'tm.ensure_clean' instead)
PDF009'pytest.raises' used without 'match='
PDF010'pytest.raises' used outside of context manager
PDF011found 'pytest.warns' (use 'pandas._testing.assert_produces_warning')
PDF012found 'pytest.xfail' (use 'pytest.mark.xfail' instead)
PDF013import from 'conftest' found
PDF014found import from 'pandas._testing' (use 'import pandas._testing as tm')
PDF015from import from 'pandas.testing' (use 'import pandas._testing as tm')
PDF016found '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
PDF019found both 'pd.foo' and 'foo' in the same file
PDF020found private import across modules
PDF021found 'np.bool' or 'np.object' (use 'np.bool_' or 'np.object_' instead)
PDF022found import from 'numpy.random'
PDF023found assignment to single-letter variable
PDF024found string join() with generator expressions
PDF025found 'np.testing' or 'np.array_equal' (use 'pandas._testing' instead)
PDF026found union between Series and AnyArrayLike in type hint

contributing

Seecontributing.md for how to get started.

Each new linting rule should be its own file insidepandas-dev-flaker/_plugins. Please linting rule should have two sets of tests inpandas-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 frompyupgrade. Some of the checks were taken from thepandas repo. Please find both their licenses in theLICENSES folder.

as a pre-commit hook

Seepre-commit for instructions

Sample.pre-commit-config.yaml:

-repo:https://github.com/pycqa/flake8rev:3.9.0hooks:    -id:flake8additional_dependencies:[pandas-dev-flaker==0.5.0]

About

flake8 plugin used for pandas development

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp