Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ConfigurationPreference::FilesystemOnly #16258

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/ruff_server/src/session/index/ruff_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ impl ConfigurationTransformer for EditorConfigurationTransformer<'_> {
filesystem_configuration.combine(editor_configuration)
}
ConfigurationPreference::EditorOnly => editor_configuration,
ConfigurationPreference::FilesystemOnly => filesystem_configuration,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/ruff_server/src/session/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ pub(crate) enum ConfigurationPreference {
FilesystemFirst,
/// `.toml` files are ignored completely, and only the editor configuration is used.
EditorOnly,
/// The editor configuration is ignored completely, and only `.toml` files are used.
FilesystemOnly,
}

/// This is a direct representation of the settings schema sent by the client.
Expand Down
3 changes: 2 additions & 1 deletion docs/editors/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ configuration is prioritized over `ruff.toml` and `pyproject.toml` files.
- `"filesystemFirst"`: Configuration files present in the workspace takes priority over editor
settings.
- `"editorOnly"`: Ignore configuration files entirely i.e., only use editor settings.
- `"filesystemOnly"`: Ignore editor settings entirely i.e., only use configuration files.

**Default value**: `"editorFirst"`

**Type**: `"editorFirst" | "filesystemFirst" | "editorOnly"`
**Type**: `"editorFirst" | "filesystemFirst" | "editorOnly" | "filesystemOnly"`

**Example usage**:

Expand Down
Loading