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, duration hours minute second in high quality that is uploaded to the channel Very Academy 23 February 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 10,210 times and liked it 175 visitors.