2025-02-14 20:03:17 +00:00
|
|
|
# from default `ruff.toml` @
|
|
|
|
|
# https://docs.astral.sh/ruff/configuration/
|
|
|
|
|
|
|
|
|
|
# Exclude a variety of commonly ignored directories.
|
|
|
|
|
exclude = [
|
|
|
|
|
".bzr",
|
|
|
|
|
".direnv",
|
|
|
|
|
".eggs",
|
|
|
|
|
".git",
|
|
|
|
|
".git-rewrite",
|
|
|
|
|
".hg",
|
|
|
|
|
".ipynb_checkpoints",
|
|
|
|
|
".mypy_cache",
|
|
|
|
|
".nox",
|
|
|
|
|
".pants.d",
|
|
|
|
|
".pyenv",
|
|
|
|
|
".pytest_cache",
|
|
|
|
|
".pytype",
|
|
|
|
|
".ruff_cache",
|
|
|
|
|
".svn",
|
|
|
|
|
".tox",
|
|
|
|
|
".venv",
|
|
|
|
|
".vscode",
|
|
|
|
|
"__pypackages__",
|
|
|
|
|
"_build",
|
|
|
|
|
"buck-out",
|
|
|
|
|
"build",
|
|
|
|
|
"dist",
|
|
|
|
|
"node_modules",
|
|
|
|
|
"site-packages",
|
|
|
|
|
"venv",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Same as Black.
|
|
|
|
|
line-length = 88
|
|
|
|
|
indent-width = 4
|
|
|
|
|
|
2026-03-04 22:17:51 +00:00
|
|
|
# !XXX sync with `pyproject.toml`!
|
2025-02-14 20:03:17 +00:00
|
|
|
target-version = "py312"
|
|
|
|
|
|
|
|
|
|
# ------ - ------
|
|
|
|
|
# TODO, stop warnings around `anext()` builtin use?
|
|
|
|
|
# tool.ruff.target-version = "py310"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[lint]
|
2026-03-11 23:40:51 +00:00
|
|
|
select = [
|
|
|
|
|
# pycodestyle error subsets (pre-existing)
|
|
|
|
|
"E4", "E7", "E9",
|
|
|
|
|
# pyflakes (pre-existing)
|
|
|
|
|
"F",
|
|
|
|
|
|
|
|
|
|
# -- pydocstyle: enforce piker's ''' multiline style --
|
|
|
|
|
# D2xx whitespace and formatting rules; most are
|
|
|
|
|
# auto-fixable via `ruff check --fix`.
|
|
|
|
|
# NOTE: D1xx (missing-docstring) rules intentionally
|
|
|
|
|
# excluded to avoid noise across the existing codebase.
|
|
|
|
|
"D2",
|
|
|
|
|
# D4xx content checks (cherry-picked)
|
|
|
|
|
"D402", # first line != function signature
|
|
|
|
|
"D403", # capitalize first word
|
|
|
|
|
"D419", # no empty docstrings
|
|
|
|
|
# NOTE: D3xx skipped entirely since D300 enforces
|
|
|
|
|
# triple-double-quotes `"""` which conflicts with
|
|
|
|
|
# piker's `'''` convention (the formatter's
|
|
|
|
|
# `quote-style = "single"` handles conversion).
|
|
|
|
|
|
|
|
|
|
# pycodestyle warnings
|
|
|
|
|
"W",
|
|
|
|
|
]
|
|
|
|
|
ignore = [
|
|
|
|
|
# -- pydocstyle ignores for piker conventions --
|
|
|
|
|
# piker ALWAYS uses multiline docstring style, never
|
|
|
|
|
# single-line, so disable the "fit on one line" rule.
|
|
|
|
|
"D200",
|
|
|
|
|
# piker uses NO blank line before class docstrings
|
|
|
|
|
# (D211) not 1-blank-line (D203); these conflict.
|
|
|
|
|
"D203",
|
|
|
|
|
# piker puts the summary on the SECOND line after
|
|
|
|
|
# an opening `'''` (D213); not on the same line as
|
|
|
|
|
# the opening quotes (D212); these conflict.
|
|
|
|
|
"D212",
|
|
|
|
|
]
|
2025-02-14 20:03:17 +00:00
|
|
|
ignore-init-module-imports = false
|
|
|
|
|
|
|
|
|
|
[lint.per-file-ignores]
|
|
|
|
|
"piker/ui/qt.py" = [
|
|
|
|
|
"E402",
|
|
|
|
|
'F401', # unused imports (without __all__ or blah as blah)
|
|
|
|
|
# "F841", # unused variable rules
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Allow fix for all enabled rules (when `--fix`) is provided.
|
|
|
|
|
fixable = ["ALL"]
|
|
|
|
|
unfixable = []
|
|
|
|
|
|
2025-04-22 01:22:32 +00:00
|
|
|
# TODO? uhh why no work!?
|
2025-02-14 20:03:17 +00:00
|
|
|
# Allow unused variables when underscore-prefixed.
|
2025-04-22 01:22:32 +00:00
|
|
|
# dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
2025-02-14 20:03:17 +00:00
|
|
|
|
|
|
|
|
[format]
|
|
|
|
|
# Use single quotes in `ruff format`.
|
|
|
|
|
quote-style = "single"
|
|
|
|
|
|
|
|
|
|
# Like Black, indent with spaces, rather than tabs.
|
|
|
|
|
indent-style = "space"
|
|
|
|
|
|
|
|
|
|
# Like Black, respect magic trailing commas.
|
|
|
|
|
skip-magic-trailing-comma = false
|
|
|
|
|
|
|
|
|
|
# Like Black, automatically detect the appropriate line ending.
|
|
|
|
|
line-ending = "auto"
|
|
|
|
|
|
2026-03-11 23:40:51 +00:00
|
|
|
# Auto-format code examples inside docstrings
|
|
|
|
|
# (>>> blocks, code fences, etc.)
|
|
|
|
|
docstring-code-format = true
|
|
|
|
|
|
|
|
|
|
# Use piker's 67-char target for code inside docstrings
|
|
|
|
|
# (only applies when `docstring-code-format = true`).
|
|
|
|
|
docstring-code-line-length = 67
|