Here is a quick guide on how to set up Python Black and isort in visual studio code. isort and Black works really well together and comes baked in starting with version 5. All we need to do to use isort alongside Black is to set the isort profile to "--profile=black".
{
"python.pythonPath": "venv\\Scripts\\python.exe",
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--line-length=119"
],
"python.sortImports.args": [
"--profile=black",
],
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
✨ Support us - join us as a Very Academy Member
/ @veryacademy
👍SUBSCRIBE to get more free tutorials, courses and code snippets!
/ @veryacademy
👍👍Follow us on Facebook
/ veryacademycom-113232103670580
👍👍👍Follow use on Twitter:
/ veryacademy
Watch video Set up Python Black and isort on Visual Studio Code online without registration, duration hours minute second in high quality. This video was added by user Very Academy 23 February 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 10,210 once and liked it 175 people.