[flake8]
ignore =
    # whitespace before ':' (Black)
    E203,
    # E501 line too long
    E501,
    # global unused (TODO: Solve and remove exclusion)
    F824,
    # line break before binary operator (Black)
    W503,

per-file-ignores =
    # Files and directories which need fixes or specific exceptions
    # Many of these ignores can and should be removed and the problem fixed.
    # Quick reference for some of the most common errors
    # F403 star import used; unable to detect undefined names
    # F405 variable may be undefined, or defined from star imports
    # E402 module level import not at top of file
    # E501 line too long
    # E722 do not use bare 'except'
    # W605 invalid escape sequence
    # F821 undefined name 'unicode'
    # E741 ambiguous variable name 'l'
    man/build_html.py: E501
    man/build_md.py: E501
    doc/examples/python/m.distance.py: E501
    gui/scripts/d.wms.py: E501
    gui/wxpython/image2target/g.gui.image2target.py: E501
    gui/wxpython/photo2image/g.gui.photo2image.py: E501
    gui/wxpython/psmap/*: E501
    gui/wxpython/animation/g.gui.animation.py: E501
    gui/wxpython/tplot/g.gui.tplot.py: E501
    gui/wxpython/iclass/g.gui.iclass.py: E501
    gui/wxpython/mapdisp/test_mapdisp.py: E501
    gui/wxpython/mapswipe/g.gui.mapswipe.py: E501
    gui/wxpython/timeline/g.gui.timeline.py: E501
    # Generated file
    gui/wxpython/menustrings.py: E501
    # C wrappers call libgis.G_gisinit before importing other modules.
    # TODO: Is this really needed?
    python/grass/jupyter/__init__.py: E501
    # Configuration file for Sphinx:
    # Ignoring import/code mix and line length.
    # Files not managed by Black
    # E402 module level import not at top of file
    scripts/r.semantic.label/r.semantic.label.py: E501
    scripts/g.extension/g.extension.py: E501
    scripts/v.unpack/v.unpack.py: E501
    scripts/v.import/v.import.py: E501
    scripts/db.univar/db.univar.py: E501
    scripts/i.pansharpen/i.pansharpen.py: E501
    scripts/v.what.strds/v.what.strds.py: E501
    # Line too long (esp. module interface definitions)
    scripts/*/*.py: E501
    temporal/t.rast.to.vect/t.rast.to.vect.py: E501
    temporal/t.vect.algebra/t.vect.algebra.py: E501
    temporal/t.rast.what/t.rast.what.py: E501
    # Line too long (esp. module interface definitions)
    temporal/*/*.py: E501


max-line-length = 88
# Remember to remove the exclusions from .pre-commit-config.yaml when removing here
exclude =
    .git,
    __pycache__,
    .env,
    .venv,
    env,
    venv,
    ENV,
    env.bak,
    venv.bak,
    # Build directories
    bin.*,
    dist.*,
    OBJ.*,
    # Test output directory
    testreport,
    # Not yet compliant
    python/grass/temporal/ply,
    python/libgrass_interface_generator,
    # No tests checked for now
    testsuite,

builtins =
    _
