Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

1.8 KB
Raw Blame
# TOML configuration for tools that support it should be placed in this file
# We do not use pyproject.toml to describe build requirements. This file
# should only be referenced for tool configuration, not build settings!

[tool.codespell]
exclude-file = ".codespell/ignore_lines.txt"
ignore-words = ".codespell/ignore_words.txt"

[tool.ruff.lint]
# Pin the base rule set explicitly so that Ruff upgrades that change
# the default selection do not silently enable new rules.
# All additional rules must be added using `extend-select`.
select = ["E4", "E7", "E9", "F"]
extend-select = [
  "UP",  # pyupgrade, https://docs.astral.sh/ruff/rules/#pyupgrade-up
  "D",  # pydocstyle, https://docs.astral.sh/ruff/rules/#pydocstyle-d
  "I",  # isort, https://docs.astral.sh/ruff/rules/#isort-i
]
ignore = [
  "D1",  # D1xx: we do not want to force contributors to write redundant or useless docstrings
  "D202",  # D202: additional whitespace helps with readability
  "D205",  # D205: we don't want to always require a single line summary
  "D211",  # D211: same as D202
  "D400",  # D400: first line doesn't need to end in a period
]

[tool.ruff.lint.per-file-ignores]
"*test*" = ["E501"]  # Tests should have long, descriptive names.
"*__init__*" = ["F401"]  # Init files usually have unused imports.

[tool.ruff.lint.pydocstyle]
convention = "pep257"

[tool.ruff.lint.isort]
lines-after-imports = 2
section-order = [
  "future",
  "standard-library",
  "django",
  "third-party",
  "first-party",
  "local-folder",
]
known-first-party = [
  "conf",
  "api",
  "ingestion_server",
  "indexer_worker",
  "common",
  "data_augmentation",
  "data_refresh",
  "database",
  "elasticsearch_cluster",
  "legacy_data_refresh",
  "maintenance",
  "oauth2",
  "providers",
  "test",
]

[tool.ruff.lint.isort.sections]
django = ["django", "rest_framework"]