Skip to content

Commit

Permalink
Add supported settings to README
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed May 22, 2024
1 parent 0716e89 commit b383650
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 16 deletions.
47 changes: 32 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,38 @@ This requires Ruff version `v0.1.3` or later.

## Settings

| Settings | Default | Description |
| ------------------------------------ | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| codeAction.disableRuleComment.enable | `true` | Whether to display Quick Fix actions to disable rules via `noqa` suppression comments. |
| codeAction.fixViolation.enable | `true` | Whether to display Quick Fix actions to autofix violations. |
| enable | `true` | Whether to enable the Ruff extension. Modifying this setting requires restarting VS Code to take effect. |
| fixAll | `"explicit"` | Whether to register Ruff as capable of handling `source.fixAll` actions. |
| ignoreStandardLibrary | `true` | Whether to ignore files that are inferred to be part of the Python standard library. |
| importStrategy | `fromEnvironment` | Strategy for loading the `ruff` executable. `fromEnvironment` picks up Ruff from the environment, falling back to the bundled version if needed. `useBundled` uses the version bundled with the extension. |
| interpreter | `[]` | Path to a Python interpreter to use to run the linter server. |
| lint.args | `[]` | Additional command-line arguments to pass to `ruff check`, e.g., `"args": ["--config=/path/to/pyproject.toml"]`. Supports a subset of Ruff's command-line arguments, ignoring those that are required to operate the LSP, like `--force-exclude` and `--verbose`. |
| lint.enable | `true` | Whether to enable linting. Set to `false` to use Ruff exclusively as a formatter. |
| lint.run | `onType` | Run Ruff on every keystroke (`onType`) or on save (`onSave`). |
| organizeImports | `"explicit"` | Whether to register Ruff as capable of handling `source.organizeImports` actions. |
| path | `[]` | Path to a custom `ruff` executable, e.g., `["/path/to/ruff"]`. |
| showNotifications | `off` | Setting to control when a notification is shown: `off`, `onError`, `onWarning`, `always`. |
| Settings | Default | Description |
| -------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `codeAction.disableRuleComment.enable` | `true` | Whether to display Quick Fix actions to disable rules via `noqa` suppression comments. |
| `codeAction.fixViolation.enable` | `true` | Whether to display Quick Fix actions to autofix violations. |
| `enable` | `true` | Whether to enable the Ruff extension. Modifying this setting requires restarting VS Code to take effect. |
| `fixAll` | `"explicit"` | Whether to register Ruff as capable of handling `source.fixAll` actions. |
| `ignoreStandardLibrary` | `true` | Whether to ignore files that are inferred to be part of the Python standard library. |
| `importStrategy` | `fromEnvironment` | Strategy for loading the `ruff` executable. `fromEnvironment` finds Ruff in the environment, falling back to the bundled version; `useBundled` uses the version bundled with the extension. |
| `interpreter` | `[]` | Path to a Python interpreter to use to run the linter server. |
| `lint.args` | `[]` | Additional command-line arguments to pass to `ruff check`, e.g., `"args": ["--config=/path/to/pyproject.toml"]`. _This setting is **not** supported under `nativeServer: true`._ |
| `lint.enable` | `true` | Whether to enable linting. Set to `false` to use Ruff exclusively as a formatter. |
| `lint.run` | `onType` | Run Ruff on every keystroke (`onType`) or on save (`onSave`). |
| `format.args` | `[]` | Additional command-line arguments to pass to `ruff format`. _This setting is **not** supported under `nativeServer: true`._ |
| `organizeImports` | `"explicit"` | Whether to register Ruff as capable of handling `source.organizeImports` actions. |
| `path` | `[]` | Path to a custom `ruff` executable, e.g., `["/path/to/ruff"]`. |
| `showNotifications` | `off` | Setting to control when a notification is shown: `off`, `onError`, `onWarning`, `always`. |
| `nativeServer` | `false` | _Whether to use the Rust-based language server._ |

The following settings are exclusive to the Rust-based language server:

| Settings | Default | Description |
| ------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------- |
| `configuration` | `null` | _Path to a `ruff.toml` or `pyproject.toml` file to use for configuration._ |
| `configurationPreference` | `editorFirst` | _The strategy to use when resolving settings across VS Code and the filesystem._ |
| `exclude` | `[]` | _Glob patterns to exclude files from linting._ |
| `lineLength` | `88` | _The line length to use for the linter and formatter._ |
| `lint.preview` | `false` | _Whether to enable Ruff's preview mode when linting._ |
| `lint.select` | `[]` | _Rules to enable by default. See [the documentation](https://docs.astral.sh/ruff/settings/#lint_select)._ |
| `lint.extendSelect` | `[]` | _Rules to enable in addition to those in `lint.select`._ |
| `lint.ignore` | `[]` | _Rules to disable by default. See [the documentation](https://docs.astral.sh/ruff/settings/#lint_ignore)._ |
| `lint.extendIgnore` | `[]` | _Rules to disable in addition to those in `lint.ignore`._ |
| `format.preview` | `false` | _Whether to enable Ruff's preview mode when formatting._ |

### Configuring VS Code

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"properties": {
"ruff.nativeServer": {
"default": false,
"markdownDescription": "Use the new beta language server, integrated with Ruff.",
"markdownDescription": "Use the integrated Rust-based language server, available now in Beta.",
"scope": "window",
"type": "boolean"
},
Expand Down

0 comments on commit b383650

Please sign in to comment.