Skip to content

Commit

Permalink
add info and schema for code actions on save (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Feb 13, 2023
1 parent cb14882 commit 6711ef8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,22 @@

This is a helper package that automatically installs and updates [ruff-lsp](https://github.com/charliermarsh/ruff-lsp) for you. Ruff is an extremely fast Python linter and code transformation tool, written in Rust.

## Requirements

To use this package, you must have:

- An executable `python` (on Windows) or `python3` (on Linux/macOS)
- The [LSP](https://packagecontrol.io/packages/LSP) package
- For Ubuntu and Debian users, you must also install python3-venv with apt
- It's recommended to also install the [LSP-json](https://packagecontrol.io/packages/LSP-json) package which will provide auto-completion and validation for this package's settings.
- It's recommended to also install the [LSP-json](https://packagecontrol.io/packages/LSP-json) package which will provide auto-completion and validation for this package's settings.

## Code Actions on Save

The following "code actions on save" are supported:

- `source.fixAll`
- `source.organizeImports`
- `source.fixAll.ruff`
- `source.organizeImports.ruff`

You can use those with the `lsp_code_actions_on_save` LSP Setting to automatically apply specific actions on saving the file.
21 changes: 20 additions & 1 deletion sublime-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,25 @@
}
}
},
{
"file_patterns": [
"LSP.sublime-settings"
],
"schema": {
"properties": {
"lsp_code_actions_on_save": {
"properties": {
"source.fixAll.ruff": {
"type": "boolean"
},
"source.organizeImports.ruff": {
"type": "boolean"
}
}
}
}
}
},
]
}
}
}

0 comments on commit 6711ef8

Please sign in to comment.