Enable RUF013 to enforce optional typing (#37266)
* Enable RUF013 for Optional typing Signed-off-by: cyy <cyyever@outlook.com> * Add Optional to types * Format code Signed-off-by: cyy <cyyever@outlook.com> --------- Signed-off-by: cyy <cyyever@outlook.com>
This commit is contained in:
@@ -20,7 +20,9 @@ line-length = 119
|
||||
[tool.ruff.lint]
|
||||
# Never enforce `E501` (line length violations).
|
||||
ignore = ["C901", "E501", "E741", "F402", "F823" ]
|
||||
select = ["C", "E", "F", "I", "W"]
|
||||
# RUF013: Checks for the use of implicit Optional
|
||||
# in type annotations when the default parameter value is None.
|
||||
select = ["C", "E", "F", "I", "W", "RUF013"]
|
||||
|
||||
# Ignore import violations in all `__init__.py` files.
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
|
||||
Reference in New Issue
Block a user