Replies: 2 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
isort is a formatter for import statements
Beta Was this translation helpful? Give feedback.
All reactions