Open5

vscode 設定メモ

scnshscnsh

rust

{
	"settings": {
        "[rust]": {
            "editor.defaultFormatter": "rust-lang.rust-analyzer"
            "editor.formatOnSave": true,
        },
    }
}
scnshscnsh

rust プロジェクトは共通で保存時フォーマットは有効にして良いと思うので、ユーザーの settings.json に書いて良麻生。

scnshscnsh

python(black + autoflake)

	"settings": {
		"python.formatting.provider": "black",
		"python.formatting.blackArgs": [
			"--line-length=120"
		],
		"[python]": {
			"editor.defaultFormatter": null,
			"editor.formatOnSave": true,
			"editor.codeActionsOnSave": {
				"source.organizeImports": true,
				"source.fixAll": true
			},
		},
		// "black-formatter.args":[
		// 	"--line-length=120"
		// ],
		"files.insertFinalNewline": true,
		"files.trimTrailingWhitespace": true,
		"python.linting.flake8Enabled": true,
		"python.linting.flake8Path": "${workspaceFolder}/.venv/bin/autoflake",
		"python.linting.flake8Args": [
			"--max-line-length=120",
		],
		"python.testing.pytestArgs": [
			"test"
		],
		"python.testing.unittestEnabled": false,
		"python.testing.pytestEnabled": true
	}

関連して導入する拡張機能

便利系(python)

注意点

scnshscnsh

便利系の拡張機能

参考
https://qiita.com/nanato12/items/ddf26487eb30714251c3

scnshscnsh

Python(ruff)

{
	"settings": {
		"[python]": {
			"editor.defaultFormatter": null,
			"editor.formatOnSave": true,
			"editor.codeActionsOnSave": {
				"source.fixAll.ruff": true,
				"source.organizeImports.ruff": true
			},
		},
		"files.insertFinalNewline": true,
		"files.trimTrailingWhitespace": true,
	}
}