-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0cb7e21
commit d8d0bf7
Showing
11 changed files
with
268 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,39 @@ | ||
RyeCharm can trigger Ruff to format a file on three events: | ||
|
||
* File save (<kbd>Ctrl</kbd> + <kbd>S</kbd>, editor close, IDE close, etc.) | ||
* Reformat (<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>L</kbd> or similar) | ||
* Optimize imports (<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>O</kbd> or similar) | ||
* Reformat (<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>L</kbd>) | ||
* Optimize imports (<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>O</kbd>) | ||
* File save (<kbd>Ctrl</kbd> + <kbd>S</kbd>, editor tab close, IDE close, etc.) | ||
|
||
Unsupported files are not affected. | ||
|
||
|
||
## File save | ||
|
||
Everytime a file is [saved][1], automatically or manually, | ||
RyeCharm will run Ruff on it if it is a supported file. | ||
|
||
This is equivalent to running `ruff format --quiet` with the file as input. | ||
|
||
|
||
## Reformat | ||
|
||
This event happens when the [<i>Reformat Code</i>][2] action | ||
(<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>L</kbd> or similar) | ||
This event happens when the [<i>Reformat Code</i>][1] action | ||
(<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>L</kbd>) | ||
is triggered, possibly with some code selected. | ||
|
||
This is equivalent to running `ruff format --quiet --range ...` | ||
In <i>Command line</i> mode, this is equivalent to | ||
running `ruff format --quiet --range ...` | ||
with the file and the selected range as input. | ||
|
||
|
||
## Optimize imports | ||
|
||
This event happens when the [<i>Optimize Imports</i>][3] action | ||
(<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>O</kbd> or similar) | ||
is triggered. | ||
This event happens when the [<i>Optimize Imports</i>][2] action | ||
(<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>O</kbd>) is triggered. | ||
|
||
This is equivalent to running `ruff check --fix --exit-zero --quiet --select I` | ||
with the file as input. | ||
|
||
|
||
[1]: https://www.jetbrains.com/help/pycharm/saving-and-reverting-changes.html | ||
[2]: https://www.jetbrains.com/help/pycharm/reformat-and-rearrange-code.html | ||
[3]: https://www.jetbrains.com/help/pycharm/creating-and-optimizing-imports.html#optimize-imports | ||
## File save | ||
|
||
This event happens when a file is [saved][3], automatically or manually. | ||
|
||
This is equivalent to running `ruff format --quiet` with the file as input. | ||
|
||
|
||
[1]: https://www.jetbrains.com/help/pycharm/reformat-and-rearrange-code.html | ||
[2]: https://www.jetbrains.com/help/pycharm/creating-and-optimizing-imports.html#optimize-imports | ||
[3]: https://www.jetbrains.com/help/pycharm/saving-and-reverting-changes.html |
Oops, something went wrong.