본문 바로가기

잡것들

VSCode python auto lint, black format, organize import

VSCode python

자동으로 lint, black formatting, import정리 설정 방법

 

설정하고 하는 workspace로 들어가

.vscode/settings.json에 아래처럼 입력하면 된다.

{
    "python.linting.enabled": true,
    "python.linting.lintOnSave": true,
    "python.linting.flake8Enabled": true,
    "python.linting.flake8Args": [
        "--max-line-length=119",
    ],
    "python.formatting.provider": "black",
    "python.formatting.blackArgs": [
        "--line-length",
        "119",
    ],
    "isort.args": [
        "--case-sensitive",
        "--dont-order-by-type",
        "--profile",
        "black",
    ],
    "[python]": {
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        },
        "editor.formatOnSave": true,
    },
    "python.analysis.autoImportCompletions": true
}

'잡것들' 카테고리의 다른 글