content: [tool.pylint.BASIC]
  good-names = [
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "ex",
    "Run",
    "_",
    "x",
    "y",
    "z"
  ]
  
  [tool.pylint.main]
  
  [tool.pylint.messages_control]
  disable = [
    "abstract-method",
    "broad-exception-caught",
    "c-extension-no-member",
    "consider-using-f-string",
    "consider-using-from-import",
    "cyclic-import", # Disable cyclic-import because it is pylint bug
    "expression-not-assigned",
    "fixme",
    "format",
    "import-error",
    "import-outside-toplevel",
    "invalid-name",
    "line-too-long",
    "missing-docstring",
    "no-else-continue",
    "no-else-raise",
    "no-else-return",
    "no-member",
    "no-name-in-module",
    "no-self-argument",
    "too-few-public-methods",
    "too-many-ancestors",
    "too-many-arguments",
    "too-many-branches",
    "too-many-function-args",
    "too-many-instance-attributes",
    "too-many-locals",
    "too-many-nested-blocks",
    "too-many-positional-arguments",
    "too-many-public-methods",
    "too-many-return-statements",
    "too-many-statements",
    "unspecified-encoding",
    "unused-argument",
    "unused-wildcard-import",
    "used-before-assignment",
    "wrong-import-order" # import order is handled by the formatter (ruff)
  ]
  
  [tool.pytest.ini_options]
  addopts = "-rsfEX --tb=short --color=yes"
  
  [tool.ruff]
  line-length = 120
  target-version = "py39"
  
  [tool.ruff.lint]
  select = [
    "A", # flake8-builtins
    "B", # flake8-bugbear
    "C4", # flake8-comprehensions
    "CPY", # flake8-copyright
    "D", # flake8-docstrings,
    "E", # pycodestyle
    "F", # Pyflakes
    "FLY", # flake8-flynt
    "G", # flake8-logging-format
    "I", # isort
    "ICN", # flake8-import-conventions
    "INP", # flake8-no-pep420
    "INT", # flake8-gettext
    "ISC", # flake8-implicit-str-concat
    "LOG", # flake8-logging
    "N", # pep8-naming
    "NPY", # numpy
    "PD", # flake8-pandas
    "PERF", # Perflint
    "PGH", # pygrep-hooks
    "PIE", # flake8-pie
    "PLC", # pylint conventions
    "PLE", # pylint errors
    "PLW", # pylint warnings
    "PT", # flake8-pytest
    "PTH", # flake8-use-pathlib
    "PYI", # flake8-pyi
    "Q", # flake8-quotes
    "RET", # flake8-return
    "RSE", # flake8-raise
    "RUF", # Ruff-specific rules
    "SIM", # flake8-simplify
    "T10", # flake8-debugger
    "T20", # flake8-print
    "TCH", # flake8-type-checking
    "TD", # flake8-todo
    "TID", # flake8-tidy-imports
    "TRY", # tryceratops
    "UP", # pyupgrade
    "W", # pycodestyle
    "YTT" # flake8-2020,
  ]
  # NOTE: Refrain from growing the ignore list unless for exceptional cases.
  # Always include a comment to explain why.
  ignore = [
    "A005", # Ignore modules using the same names as Python standard-library modules
    "B028", # FIXME: Add stacklevel to warnings
    "B905", # keep using less than Python 3.10. The strict is added in Python 3.10
    "D100", # Ignore missing docstring in public module
    "D101", # Ignore missing docstring in public class
    "D102", # Ignore missing docstring in public method
    "D103", # Ignore missing docstring in public function
    "D104", # Ignore missing docstring in public package
    "D105", # Ignore missing docstring in magic method
    "D106", # Ignore missing docstring in public nested class
    "D107", # Ignore missing docstring in __init__
    "D406", # Ignore new line after section name
    "D407", # Ignore dashed-underline-after-section
    "E501", # Ignore line too long. The formatter will handle it.
    "N803", # Argument casing
    "N812", # Allow import torch.nn.functional as F
    "N999", # Module names
    "NPY002", # np.random.Generator may not always fit our use cases
    "PERF203", # "try-except-in-loop" only affects Python <3.11, and the improvement is minor; can have false positives
    "PGH004", # used to make ruff ignore the file
    "PLW0603", # TODO: temp disable global variable check
    "PT019", # Ignore pytest fixture name
    "PTH100", # We still support os.path.abspath
    "PTH103", # We still support os.makedirs
    "PTH106", # We still support os.rmdir
    "PTH107", # We still support os.remove
    "PTH110", # We still support os.path.exists
    "PTH118", # We still need support os.path.join
    "PTH119", # We still need support os.path.basename
    "PTH120", # We still need support os.path.dirname
    "PTH123", # we still need built-in open
    "RET505", # We prefer if/else clauses explicitly
    "RET506", # We prefer if/else clauses explicitly
    "RET507", # We prefer if/else clauses explicitly
    "RUF010", # keeping using str type explicitly
    "RUF013", # Ignore Optional type hints warning since it is available in Python 3.10
    "SIM105", # We don't prefer use context.suppress
    "SIM108", # We don't encourage ternary operators
    "TD003", # Ignore TODO links
    "TRY002", # Ignore create custom exception
    "TRY003", # Ignore check message not defined in the exception class
    "TRY004", # Ignore prefer TypeError over ValueError
    "TRY300" # Ignore check if return in try block
  ]
  
  [tool.ruff.lint.flake8-tidy-imports]
  # Disallow all relative imports.
  ban-relative-imports = "all"
  
  [tool.ruff.lint.pep8-naming]
  # Allow Pydantic's `@validator` decorator to trigger class method treatment.
  classmethod-decorators = ["classmethod", "olive.common.pydantic_v1.validator", "olive.common.pydantic_v1.root_validator"]
  
  [tool.ruff.lint.per-file-ignores]
  ".azure_pipelines/**" = ["INP001"]
  "docs/**" = ["INP001"]
  "test/**" = ["INP001"]
  "scripts/**" = ["INP001"]
  "olive/cli/**" = ["T201"]
  