[flake8]
# Configuration for flake8 linting
max-line-length = 88

# Extend ignore: Black compatibility + documentation
extend-ignore =
    E203,
    W503,
    D100,
    D104,
    D105,
    E402

# Exclude patterns
exclude =
    .git,
    __pycache__,
    .pytest_cache,
    .ipynb_checkpoints,
    build,
    dist,
    *.egg-info,
    .tox,
    .venv,
    venv,
    docs/_build,
    tests/fixtures,
    # Legacy files that may not conform
    epyr/fair_original_backup.py

# File patterns to check
filename = *.py

# Maximum cyclomatic complexity. Raised from 15 to 35 to accommodate legacy
# functions (baseline_auto_1d, save_to_hdf5, _setup_bounds, isotope_gui tables).
# These should be refactored progressively; the limit can be lowered once done.
max-complexity = 35

# Error codes to always show. Import order is isort's job, not flake8's.
select =
    E,   # pycodestyle errors
    W,   # pycodestyle warnings
    F,   # pyflakes
    C,   # mccabe complexity
    B,   # flake8-bugbear

# Per-file ignores
per-file-ignores =
    # Test files can be more lenient
    tests/*.py: D,F401,F811
    # Init files often have unused imports
    __init__.py: F401
    # CLI module may have long functions
    epyr/cli.py: C901
    # Configuration files
    conftest.py: D100