Replies: 3 comments 7 replies
-
Installing pyls-isort should work, but I didn't test. |
Beta Was this translation helpful? Give feedback.
5 replies
-
If you use [[language]]
name = "python"
auto-format = true
formatter = { command = "sh", args = ["-c", "black --quiet - | isort -"]} Edit: here's one that also works with [[language]]
name = "python"
auto-format = true
[language.formatter]
command = "bash"
args = [
"-c",
"""
set -eou pipefail
COMMAND="cat"
if command -v black &> /dev/null; then
COMMAND+=" | black --quiet -"
fi
if command -v isort &> /dev/null; then
COMMAND+=" | isort -"
fi
if command -v ruff &> /dev/null; then
COMMAND+=" | ruff check --select I --fix -"
fi
echo "$COMMAND" >&2
eval "$COMMAND"
""",
] |
Beta Was this translation helpful? Give feedback.
2 replies
-
Received!
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
isort is a formatter for import statements
Beta Was this translation helpful? Give feedback.
All reactions