# The .pylintrc file for Leo itself.

# 9/21/24: All files pass with:
#   pylint 3.2.7
#   astroid 3.2.4
#   Python 3.12.0

[MASTER]

# Add <file or directory> to the black list. A base name, not a path.
ignore=
    .git

# Files or directories matching regex, in Windows or Posix format.
ignore-paths=
    leo\external,
    leo\extensions,
    leo\modes,
    leo\plugins\obsolete,
    leo\plugins\qt_main.py,  # Auto-generated, with long lines.
    leo\plugins\examples,
    leo\plugins\leo_babel,
    leo\plugins\pygeotag,
    leo\scripts,
    leo\unittests\py3_test_grammar,

# Pickle collected data for later comparisons.
persistent=no

[MESSAGES CONTROL]

# Enable the message, report, category or checker with the given id(s).
enable=
    basic,
    classes,
    format,
    imports,
    typecheck,
    variables

# Disable the message, report, category or checker with the given id(s).
disable=
    design,  # Make work.
    similarities,  # Expensive and unhelpful.
    
    # Leo: Standard suppressions.
        abstract-method,  # 9/21/2024
        arguments-renamed, # cursesGui2.py
        assignment-from-no-return, # Causes problems when base class return None.
        assignment-from-none, # Causes problems when base class return None.
        attribute-defined-outside-init,
        broad-except, # except Exception is justified if followed by g.es_exception.
        c-extension-no-member,  # Suppress errors re pyQt6.
        cell-var-from-loop,  # 9/21/2024: Seemingly can't be suppressed.
        condition-evals-to-constant,
        consider-iterating-dictionary,
        consider-using-from-import,
        consider-using-f-string,  # complains about regex's!
        consider-using-in,
        consider-using-dict-comprehension,
        consider-using-dict-items,
        consider-using-generator,
        consider-using-max-builtin,
        consider-using-min-builtin,
        consider-using-set-comprehension,
        consider-using-ternary,
        consider-using-with,
        cyclic-import,
        deprecated-module,
        exec-used,
        f-string-without-interpolation,  # Useful for concatenated f-strings.
        global-statement, #  Assume we know what we are doing.
        global-variable-not-assigned, # not helpful.
        import-error,  # Ignore imports of optional packages.
        import-outside-toplevel, # Requires substantial code changes.
        invalid-name,  # 9/21/2024
        keyword-arg-before-vararg, # See https://github.com/PyCQA/pylint/issues/2027
        missing-docstring, # Instead, use Leo's find-missing-docstrings command.
        no-else-break, # Possible pylint bug?
        possibly-used-before-assignment, # 9/21/2024
        protected-access,
        redeclared-assigned-name,
        redefined-argument-from-local, # I do this all the time.
        redefined-builtin, # all, next, etc. so what?
        redefined-outer-name,
        too-few-public-methods,
        too-many-branches,
        too-many-lines,
        too-many-locals,
        too-many-public-methods,
        too-many-statements,
        trailing-whitespace,  # Too picky. No need to constantly do clean-all-lines.
        unnecessary-comprehension,
        unnecessary-dunder-call,  # pylint for python 3.10 only.
        unnecessary-lambda,
        unnecessary-lambda-assignment,
        unnecessary-pass, # Can be pedantic in some situations.
        unspecified-encoding,  # Huh?
        unused-argument,
        unused-private-member, # too many false positives.
        unused-variable, # way too many false positives, esp. tuple unpacking.
        use-dict-literal,
        use-list-literal,
        use-maxsplit-arg, # What is this??
        use-yield-from,
        using-constant-test,

    # Good warnings. Don't suppress these.
    
        # bad-option-value, # obsolete pylint option.
        # unrecognized-option,  # newer python.

        # bad-builtin,
        # bad-continuation,
        # bad-option-value, # obsolete pylint option.
        # chained-comparison,
        # len-as-condition,
        # import-error, # Useful now that we are only using python 3.
        # line-too-long,  # Worth doing?
        # literal-comparison,
        # locally-disabled,
        # multiple-statements,
        # no-else-raise,
        # no-init,
        # no-value-for-parameter,
        # not-an-iterable,
        # old-style-class, # Probably not an issue.
        # simplifiable-if-statement,
        # singleton-comparison,
        # superfluous-parens,
        # trailing-comma-tuple,
        # unsupported-assignment-operation,
        # unsupported-delete-operation,
        # unsubscriptable-object,
        # useless-object-inheritance, # class x(object):
        # useless-return,

[REPORTS]

# Set the output format.  Multiple values are allowed.
output-format=text # colorized, text, parseable, msvs (visual studio)

reports=no  # Display only messages.

score=no  # Deactivate the evaluation score.

[MISCELLANEOUS]

# List of note tags to take in consideration, separated by a comma.
# notes=FIXME,XXX,TODO
notes=

[BASIC]

[CLASSES]

[DESIGN]

# Maximum number of nested blocks for function / method body
max-nested-blocks=10  # Apparently, this can't be suppressed!

[FORMAT]

# Note: the line-too-long suppression must appear before docstrings.

max-line-length=120  # 9/21/2024

[IMPORTS]

[SIMILARITIES]

[TYPECHECK]

[VARIABLES]
