VSCode

Page content

settings.json

Useful Settings for VSCode … settings.json

test -d .vscode || mkdir .vscode
cat << EOF > .vscode/settings.json
{
    "python.linting.enabled": true,
    "python.linting.pylintEnabled": true,
    "python.formatting.provider": "black",
    "python.formatting.blackArgs": [
        "--line-length=100"
    ],
    "python.sortImports.args": [
        "--profile", "black"
    ],
    "editor.formatOnSave": false,
    "[python]": {
        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        },
    },
}
EOF

launch.json

cat << EOF > .vscode/launch.json
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Test001",
            "type": "python",
            "request": "launch",
            // adapt this path below if needed, it assumes automation_cli is open as
            // root folder in your vscode workspace.
            "program": "${workspaceFolder}/project/code.py",
            "args": ["arg1", "arg2", "arg3"],
            "console": "integratedTerminal"
        },
        // default config to debug your current active file with python
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}
EOF

gitignore

cat << EOF > .gitignore
.history
__pycache__
EOF

Add Basic Packages

poetry add pylint black py-pytest

keyboards shortcuts macOS

Comment block

command + k, command + u

Uncomment block

command + k, command + u

sha256: 7cfe691d65199c0cb594ea2880b18ef75ad7057c8b4b0887c6c779316f5e3a97