Skip to content

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

@snowsignal

Description

@snowsignal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    configurationRelated to settings and configuration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions