본문 바로가기

잡것들

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
}

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

Docker container Image 한번에 삭제  (0) 2022.05.29
Onnx 시각화 프로그램 netron  (0) 2022.03.19
windows driver documentation  (0) 2022.01.05
FlexASIO Driver 빌드&설치법  (0) 2021.10.20
Visual Studio CMake 환경 구성하기  (0) 2021.10.20