# flake8 doesn't support pyproject.toml yet https://github.com/PyCQA/flake8/issues/234
[flake8]
# References:
# https://flake8.readthedocs.io/en/latest/user/configuration.html
# https://flake8.readthedocs.io/en/latest/user/error-codes.html

# Note: there cannot be spaces after commas here
exclude = __init__.py,versioneer.py,distributed/_concurrent_futures_thread.py
ignore =
    # Ignores below are aligned with black https://github.com/psf/black/blob/main/.flake8
    # Whitespace before ':'
    E203
    # Too many leading '#' for block comment
    E266
    # Line too long, ignored in favor of B950
    E501
    # Line break occurred before a binary operator
    W503
    # Line too long
    B950
    # No explicit stacklevel in warnings.warn. FIXME we should correct this in the code
    B028
    # do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
    E721

per-file-ignores =
    **/tests/*:
        # Module level import not at top of file (to silence on pytest.importorskip)
        # See https://github.com/PyCQA/pycodestyle/issues/472
        E402,
        # Do not use variables named 'I', 'O', or 'l'
        E741,
        # Local variable name is assigned to but never used
        F841,
        # Do not call assert False since python -O removes these calls
        B011,

# B950 will only trigger at 88
max-line-length = 80
