EASI-Leaderboard / ruff.toml
yangzhitao
chore: update ruff configuration and improve code readability
69c1753
line-length = 119
# Assume the minimum Python version
target-version = 'py310'
fix = true
exclude = ["*.pyi", "*/site-packages"]
############################
# lint rules
############################
[lint]
preview = true
select = [
"E", # pycodestyle: Error
"W", # pycodestyle: Warning
"F", # Pyflakes
"PLE", # pylint: Error
"B", # flake8-bugbear
"TC", # flake8-type-checking
"I", # isort
# "T20", # flake8-print
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG001", # unused arguments in functions
"G", # flake8-logging-format rules
"LOG", # flake8-logging rules, most of them autofixable
"TID", # flake8-tidy-imports
# Per rule enables
"ISC001", # Implicitly concatenated string literals on one line
"TRY002", # Prohibit use of `raise Exception`, use specific exceptions instead.
"TRY400", # Use `logging.exception` instead of `logging.error`
"RET505", # Unnecessary {branch} after return statement
"RET506", # Unnecessary {branch} after raise statement
"RET507", # Unnecessary {branch} after continue statement
"RET508", # Unnecessary {branch} after break statement
"SIM105", # Use contextlib.suppress({exception}) instead of try-except-pass
"SIM300", # Checks for conditions that position a constant on the left-hand side of the comparison operator, rather than the right-hand side.
"RUF005", # collection-literal-concatenation
"RUF006", # Checks for asyncio dangling task
"RUF013", # implicit-optional
"RUF015", # Checks for unnecessary iterable allocation for first element
"RUF019", # Checks for unnecessary key check
"RUF021", # parenthesize-chained-operators
"RUF022", # unsorted-dunder-all
"RUF023", # unsorted-dunder-slots
"RUF051", # if-key-in-dict-del
"RUF100", # unused-noqa
"RUF101", # redirected-noqa
]
unfixable = [
"F401", # unused imports
"F841", # unused variables
]
ignore = [
"B008", # do not perform function calls in argument defaults
"E501", # Formatted code may exceed the line length, leading to line-too-long (E501) errors.
]
[lint.per-file-ignores]
# `E402` (import violations)
"__init__.py" = ["E402"]
"examples/*" = ["E402"]
"tests/*" = ["E402"]
[lint.isort]
combine-as-imports = true
known-third-party = ["bpy"]
known-first-party = []
############################
# format rules
############################
[format]
preview = true
quote-style = "preserve"
docstring-code-format = true