vscode-ruff icon indicating copy to clipboard operation
vscode-ruff copied to clipboard

Ruff-specific array-like settings can be unintuitive when set in the extension

Open snowsignal opened this issue 8 months ago • 0 comments

Ruff version: v0.4.8 Extension version: 2024.26.0

Let's say you have a Lint > Select setting that looks like this:

Screenshot 2024-06-05 at 4 21 32 PM

which is equivalent to:

[tool.ruff.lint]
select = []

Notably, this is different from the default Lint > Select setting, which is this:

Screenshot 2024-06-05 at 4 21 47 PM

which leaves select without a value, instead of setting it to [].

This subtle difference means that if you remove all entries from Lint > Select but then forget to 'reset' the setting, you've turned off all lint rules, and may not have even realized it.

Ideally, the difference between null and [] for select and other "array-like" settings should be more clear.

snowsignal avatar Jun 05 '24 23:06 snowsignal