# Ruff is the linter of record for everything it implements; see [tool.ruff] in
# pyproject.toml. Ruff has no rule in the E121-E133 range, so the
# continuation-line indent checks come from flake8, and CI and
# scripts/run-all-checks.sh read the per-file-ignores below when they run
# `flake8 --select=E12,E13`. For every other code, this file is for anyone
# running flake8 by hand and is not authoritative.
[flake8]
max-line-length: 90
extend-ignore =
    # E201 Whitespace after '('
    # E202 Whitespace before ')'
    # E203 Whitespace before ':'
    # E211 Whitespace before '('
    # E221 Multiple spaces before operator
    # E222 Multiple spaces after operator
    # E241 Multiple spaces after ','
    # E272 Multiple spaces before keyword
    # E305 Expected 2 blank lines after end of function or class
    E201, E202, E203, E211, E221, E222, E241, E272, E305

per-file-ignores =
    # F401 module imported but unused
    # E402 Module level import not at top of file
    __init__.py: F401, E402

    # E115 Expected an indented block (comment)
    # E128 Continuation line under-indented for visual indent
    quaternion.py: E115, E128

    # E121 Continuation line under-indented for hanging indent
    # E126 Continuation line over-indented for hanging indent
    # E131 Continuation line unaligned for hanging indent
    # The _EASY_INT_POWERS and _EASY_FLOAT_POWERS tables align their keys on the
    # digit rather than the sign, so that -1 lines up under 0; that alignment is
    # deliberate and puts the entries off a four-space grid.
    scalar.py: E121, E126, E131

    # E127 Continuation line over-indented for visual indent
    # to_ra_dec_length() builds a 3x3 rotation from a stacked literal whose rows
    # are aligned as a matrix, which costs one column where a term has no sign.
    matrix3.py: E127

    # E302 Expected 2 blank lines, found 0
    item_ops.py: E302

    # E302 Expected 2 blank lines, found 0
    mask_ops.py: E302

    # E302 Expected 2 blank lines, found 0
    math_ops.py: E302

    # E302 Expected 2 blank lines, found 0
    pickler.py: E302

    # E111 Indentation is not a multiple of four
    # E231 Missing whitespace after ',', ';', or ':'
    tests/test_qube_getstate.py: E111, E231

    # E127 Continuation line over-indented for visual indent
    # E128 Continuation line under-indented for visual indent
    # E225 Missing whitespace around operator
    # E228 Missing whitespace around modulo operator
    # E231 Missing whitespace after ',', ';', or ':'
    # E251 Unexpected spaces around keyword / parameter equals
    # E261 At least two spaces before inline comment
    # F403 'from module import *' used; unable to detect undefined names
    # E501 Line too long (82 > 79 characters)
    # E712 Comparison to true should be 'if cond is true:' or 'if cond:'
    tests/*: E127, E128, E225, E228, E231, E251, E261, F403, E501, E712

    # F401 Imported but unused. Stub files re-export names using the redundant
    # "X as X" form, which flake8 does not recognize as a re-export.
    *.pyi: F401

# E111 Indentation is not a multiple of four
# E114 Indentation is not a multiple of four (comment)
# E115 Expected an indented block (comment)
# E116 Unexpected indentation (comment)
# E117 Over-indented
# E121 Continuation line under-indented for hanging indent
# E122 Continuation line missing indentation or outdented
# E124 Closing bracket does not match visual indentation
# E126 Continuation line over-indented for hanging indent
# E127 Continuation line over-indented for visual indent
# E128 Continuation line under-indented for visual indent
# E129 Visually indented line with same indent as next logical line
# E131 Continuation line unaligned for hanging indent
# E201 Whitespace after '('
# E202 Whitespace before ')'
# E203 Whitespace before ':'
# E211 Whitespace before '('
# E221 Multiple spaces before operator
# E222 Multiple spaces after operator
# E225 Missing whitespace around operator
# E226 Missing whitespace around arithmetic operator
# E227 Missing whitespace around bitwise or shift operator
# E228 Missing whitespace around modulo operator
# E231 Missing whitespace after ',', ';', or ':'
# E241 Multiple spaces after ','
# E251 Unexpected spaces around keyword / parameter equals
# E261 At least two spaces before inline comment
# E262 Inline comment should start with '# '
# E265 Block comment should start with '# '
# E266 Too many leading '#' for block comment
# E272 Multiple spaces before keyword
# E302 Expected 2 blank lines, found 0
# E303 Too many blank lines (3)
# E305 Expected 2 blank lines after end of function or class
# E402 Module level import not at top of file
# E501 Line too long (82 > 79 characters)
# E712 Comparison to true should be 'if cond is true:' or 'if cond:'
# E741 Do not use variables named 'I', 'O', or 'l'
# F401 module imported but unused
# F403 'from module import *' used; unable to detect undefined names
