diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e466499a8a..0501629fb2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,10 @@ repos: rev: v4.5.0 hooks: - id: check-json + exclude: | + (?x)^( + .*/launch.json + )$ - id: check-toml exclude: | (?x)^( diff --git a/cookiecutter/.gitignore b/cookiecutter/.gitignore new file mode 100644 index 0000000000..d6ea64289f --- /dev/null +++ b/cookiecutter/.gitignore @@ -0,0 +1,2 @@ +# Include template VSCode directory +!*/*/.vscode/ diff --git a/cookiecutter/tap-template/hooks/post_gen_project.py b/cookiecutter/tap-template/hooks/post_gen_project.py index ca51924f22..dc7134238d 100644 --- a/cookiecutter/tap-template/hooks/post_gen_project.py +++ b/cookiecutter/tap-template/hooks/post_gen_project.py @@ -28,4 +28,4 @@ shutil.rmtree(".github") if "{{ cookiecutter.ide }}" != "VSCode": - shutil.rmtree(".vscode") + shutil.rmtree(".vscode", ignore_errors=True) diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.vscode/launch.json b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.vscode/launch.json new file mode 100644 index 0000000000..2605119c4c --- /dev/null +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "{{ cookiecutter.tap_id }}", + "type": "python", + "request": "launch", + "cwd": "${workspaceFolder}", + "program": "{{ cookiecutter.library_name }}", + "justMyCode": false, + "args": [ + "--config", + ".secrets/config.json", + ], + }, + ] +}