In order to avoid making another bug due to override the function arguments in a for-loop, I find that there is a lint rule redefined-argument-from-local can detect this error. I try to enable this rule by add it to pyproject.toml
and add --preview
args in VsCode setting. But it still not work:
#pyproject.toml
[tool.ruff]
line-length = 120
[too.ruff.lint]
extend-select = ["PLR1704"]
# vscode workspace setting
{
"ruff.lint.args": [
"--preview"
]
}
Does I do it wrong with the setting?
Besides, is there any other method to detect this notorious problem in Python?