Custom formatter deletes entire file if command fails. #8427
-
#!/bin/bash
set -e
isort - | ruff check --fix - | ruff format - formatter = { command = "/home/aspizu/.config/helix/python-format.sh", args = [] } This will delete entire file if the command fails. |
Beta Was this translation helpful? Give feedback.
Answered by
aspizu
Sep 30, 2023
Replies: 2 comments 3 replies
-
The formatter needs to return a non-zero exit status in order for it to be treated as an error. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Had to use set -o pipefail |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aspizu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had to use
set -o pipefail