Skip to content

Commit

Permalink
Add ConfigurationPreference::FilesystemOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
InSyncWithFoo committed Feb 19, 2025
1 parent cfc6941 commit fe9762e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
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

0 comments on commit fe9762e

Please sign in to comment.