.flake8 1.2 KB
Newer Older
1 2
[flake8]
select = C,E,F,W
3 4 5 6 7
exclude =
    ./build,
    # A trick to exclude fluid/ but keep fluid/tests/, see more at
    # https://github.com/PaddlePaddle/Paddle/pull/46290#discussion_r976392010
    ./python/paddle/fluid/[!t]**,
8 9 10 11 12 13 14 15 16
    ./python/paddle/fluid/tra**,
    # Exclude auto-generated files
    *_pb2.py,
    # Exclude third-party libraries
    ./python/paddle/utils/gast/**,
    # Exclude files that will be removed in the future, see more at
    # https://github.com/PaddlePaddle/Paddle/pull/46782#issuecomment-1273033731
    ./python/paddle/fluid/tests/unittests/npu/**,
    ./python/paddle/fluid/tests/unittests/mlu/**
17 18
ignore =
    # E, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
19
    E203,E231,E262,E265,E266,
20
    E401,E402,
21 22
    E501,
    E711,E712,E721,E722,E731,E741,
23 24

    # F, see https://flake8.pycqa.org/en/latest/user/error-codes.html
25
    F405,
26
    F811,F821,F841,
27 28

    # W, see https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
29
    W503
30 31 32 33
per-file-ignores =
    # These files need tabs for testing.
    python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py:E101,W191
    python/paddle/fluid/tests/unittests/collective/fleet/test_hdfs1.py:E101,W191
34 35
    # Ignore unused imports in __init__.py
    __init__.py: F401