1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
[tool.ruff]
exclude = ['.git', 'build', 'dist', 'pycache__']
indent-width = 4
line-length = 99
[tool.ruff.format]
docstring-code-format = true
# From https://numpydoc.readthedocs.io/en/latest/format.html
# Extended discussion: https://github.com/pyvista/pyvista/pull/4129
# The length of docstring lines should be kept to 75 characters to facilitate
# reading the docstrings in text terminals.
docstring-code-line-length = 75
quote-style = 'single'
[tool.ruff.lint]
explicit-preview-rules = true
preview = true
extend-safe-fixes = ['EM']
extend-select = [
'A',
'AIR',
'ANN',
'ARG',
'ASYNC',
'ASYNC1',
'B',
'BLE',
'C4',
'COM',
# 'D',
'DJ',
'DTZ',
'E',
'EM',
'F',
'FA',
'FLY',
'FURB',
'I',
'ICN',
'INT',
'ISC',
'LOG',
'N',
'NPY',
'PERF',
'PGH',
'PIE',
'PT',
'PTH',
'PYI',
'RET',
'RSE',
'SIM',
'T10',
'TCH',
'TID',
'TRY',
'UP',
'W',
'YTT',
]
ignore = [
'COM812', # May cause conflicts when used with the formatter
'SIM105', # contextlib.suppress is slower and try/except seems more Pythonic
'SIM108', # long ternery operators are sometimes confusing
]
[tool.ruff.lint.isort]
combine-as-imports = true # Combines 'as' imports on the same line
force-sort-within-sections = true # Sort by name, don't cluster 'from' vs 'import'
required-imports = [
'from __future__ import annotations', # https://github.com/pyvista/pyvista/pull/5712
]
|