diff --git a/.vscode/settings.json b/.vscode/settings.json index c46f751d..75509a0a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -45,6 +45,10 @@ "multiDiffEditor.experimental.enabled": true, "mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"], "mypy-type-checker.importStrategy": "fromEnvironment", + "notebook.codeActionsOnSave": { + "notebook.source.organizeImports": "explicit" + }, + "notebook.formatOnSave.enabled": true, "python.analysis.autoImportCompletions": false, "python.analysis.inlayHints.pytestParameters": true, "python.analysis.typeCheckingMode": "strict", @@ -54,6 +58,7 @@ "redhat.telemetry.enabled": false, "rewrap.wrappingColumn": 88, "ruff.enable": true, + "ruff.importStrategy": "fromEnvironment", "ruff.organizeImports": true, "search.exclude": { "**/tests/**/__init__.py": true, diff --git a/src/compwa_policy/check_dev_files/ruff.py b/src/compwa_policy/check_dev_files/ruff.py index c2629b31..eaa74c09 100644 --- a/src/compwa_policy/check_dev_files/ruff.py +++ b/src/compwa_policy/check_dev_files/ruff.py @@ -646,6 +646,10 @@ def _update_vscode_settings() -> None: executor( vscode.update_settings, { + "notebook.codeActionsOnSave": { + "notebook.source.organizeImports": "explicit" + }, + "notebook.formatOnSave.enabled": True, "[python]": { "editor.codeActionsOnSave": { "source.organizeImports": "explicit", @@ -653,6 +657,7 @@ def _update_vscode_settings() -> None: "editor.defaultFormatter": "charliermarsh.ruff", }, "ruff.enable": True, + "ruff.importStrategy": "fromEnvironment", "ruff.organizeImports": True, }, )