[flake8]
extend-select=
    ; Use `raise from` inside `except` for error handling
    ; https://docs.python.org/3/tutorial/errors.html#exception-chaining
    B904
    ; Use Counter() instead of defaultdict(int) to avoid excessive memory use:
    B910
ignore=
    ; module level import not at top of file
    E402,
    ; line break before binary operator
    W503,
    ; line break after binary operator
    W504
    ; "experimental" SIM9xx rules (flake8-simplify)
    SIM9
    ; explicitly concatenated strings (flake8-implicit-str-concat)
    ISC003
    ; not all exception subclass __init__ args passed to super __init__
    ; see https://github.com/cylc/cylc-flow/issues/7059
    B042

per-file-ignores=
    ; TYPE_CHECKING block suggestions
    ; B904 needs explicitly excepting because it's added in extend-select
    tests/*: A, B, B904, C, E731, TC, ISC, N, SIM

    ; for clarity we don't merge 'with Conf():' context trees
    tests/unit/parsec/*: B, B904, C, SIM, TC

exclude=
    build,
    dist,
    .git,
    __pycache__,
    .tox,
    **graphql_subscribe.py,
    **data_messages_pb2.py
paths =
    ./cylc/flow
    ./tests
