From af0ff7be94d944cf23dd96cb2a0f4c732897c44f Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:28:27 +0200 Subject: [PATCH] DX: configure rewrap extension for VSCode (#192) --- .vscode/settings.json | 1 + src/repoma/check_dev_files/vscode.py | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 82a92b23..1f4e9ca5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,7 @@ "editor.formatOnSave": false }, "[git-commit]": { + "editor.rulers": [72], "rewrap.wrappingColumn": 72 }, "[json]": { diff --git a/src/repoma/check_dev_files/vscode.py b/src/repoma/check_dev_files/vscode.py index fdb49566..af3bf340 100644 --- a/src/repoma/check_dev_files/vscode.py +++ b/src/repoma/check_dev_files/vscode.py @@ -15,6 +15,10 @@ def main(has_notebooks: bool) -> None: def _update_extensions() -> None: executor = Executor() + executor( + vscode.add_extension_recommendation, + "stkb.rewrap", # cspell:ignore stkb + ) executor( vscode.remove_extension_recommendation, "travisillig.vscode-json-stable-stringify", @@ -31,6 +35,21 @@ def _update_extensions() -> None: def _update_settings(has_notebooks: bool) -> None: executor = Executor() + executor( + vscode.set_setting, + { + "editor.formatOnSave": True, + "rewrap.wrappingColumn": 88, # black + }, + ) + executor( + vscode.set_sub_setting, + "[git-commit]", + { + "editor.rulers": [72], + "rewrap.wrappingColumn": 72, + }, + ) executor(_remove_outdated_settings) executor(_update_doc_settings) if has_notebooks: