Skip to content

Commit

Permalink
DX: configure rewrap extension for VSCode (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Oct 6, 2023
1 parent 82a5355 commit af0ff7b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"editor.formatOnSave": false
},
"[git-commit]": {
"editor.rulers": [72],
"rewrap.wrappingColumn": 72
},
"[json]": {
Expand Down
19 changes: 19 additions & 0 deletions src/repoma/check_dev_files/vscode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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:
Expand Down

0 comments on commit af0ff7b

Please sign in to comment.