-
Notifications
You must be signed in to change notification settings - Fork 1
VSCode Setting Guideline
Following the conventions for linting and formatting before starting development is crucial for smooth collaboration within an agile development team. Before beginning your tasks, please ensure that all the tools used in this project are installed and configured properly. We may use a GitHub action to check the linting and formatting later. At that point, any code that doesn't adhere to the rules will fail the checking pipeline and cannot be merged into the main branch.
- Install the Pylint extension from the VSCode extensions marketplace.
- Pylint will automatically check your code when you open a python file.
- Install the Isort extension from the VSCode extensions marketplace.
- Once this extension is installed in Visual Studio Code, isort is automatically registered as an import organizer. You can use
Shift + Alt + Oto trigger the organize imports editor action. You can also trigger this from the quick fix available when imports are not organized. - You can enable import sorting on save for Python files by changing the
editor.codeActionsOnSavesetting. It also works alongside the VS Code Black formatter extension if you set the following settings:
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
},
"isort.args":["--profile", "black"],To change this setting, press COMMAND + , on macOS or CTRL + , on Windows to open the Settings menu. Once the menu is open, search for Editor: Format On Save and make sure that option is checked:
Once this is set, you can write your code as usual and it will be automatically formatted when you save the file.
@ 2024