[flake8]
max-line-length = 120

ignore =
        # E203 is not PEP 8 compliant. https://github.com/PyCQA/pycodestyle/issues/373
        E203
        # Not worrying about spaces around arithmetic operations
        E226
        # Linebreaks before/after unary operators are okay
        W503, W504
exclude =
        # Don't need to check .git
        .git,
        # Largely autogenerated
        docs/conf.py
        # Keeping bad python format to match PETSc source code
        libensemble/sim_funcs/chwirut1.py
        examples/sim_funcs/chwirut1.py

# Note that you can use wildcard exceptions with something such as
# libensemble/libensemble/tests/regression_tests/*:F401
per-file-ignores =
        # init needs to import the logger.
        libensemble/__init__.py:F401
        libensemble/libensemble/__init__.py:F401

        # worker uses regex with chars that resemble escape sequences
        libensemble/worker.py:W605

        # Need to turn of matching probes (before other imports) on some
        # systems/versions of MPI:
        libensemble/tests/standalone_tests/mpi_launch_test/create_mpi_jobs.py:E402
        libensemble/libensemble/tests/standalone_tests/mpi_launch_test/create_mpi_jobs.py:E402
        libensemble/tests/regression_tests/test_uniform_sampling_with_different_resources.py:E402

        # Similar reasoning for configuring mpi4py
        libensemble/tests/unit_tests/test_executor.py:E402

        # Matplotlib needs something set before import
        postproc_scripts/*:E402

        # Ignoring linelength in APOSMM
        libensemble/gen_funcs/*aposmm.py:E501
        examples/gen_funcs/*aposmm.py:E501

        # Need to set something before the APOSMM import
        libensemble/tests/scaling_tests/warpx/run_libensemble_on_warpx.py:E402
        examples/calling_scripts/run_libensemble_on_warpx.py:E402
        libensemble/gen_funcs/persistent_aposmm.py:E402, E501
        libensemble/tests/regression_tests/test_persistent_aposmm*:E402
        libensemble/tests/deprecated_tests/test_old_aposmm*:E402

        # Ignoring linelength in test_history.py
        libensemble/tests/unit_tests/test_history.py:E501
        libensemble/tests/unit_tests/test_allocation_funcs_and_support.py:E501

        # Allow undefined name '__version__'
        setup.py:F821
