From ca5ab66beb8edb0064c99b66dc6348282cd252bd Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 23 Aug 2024 09:26:49 -0400 Subject: [PATCH] devex: check in recommended vscode settings (#691) * check in recommended vscode settings * Update settings.default.json * Add extensions recommendations * Update extensions.json * Add readme --- .gitignore | 4 +++- .vscode/extensions.json | 5 +++++ .vscode/settings.default.json | 8 ++++++++ docs/setup.md | 10 +++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.default.json diff --git a/.gitignore b/.gitignore index b97f3588ff..b8c78700ab 100644 --- a/.gitignore +++ b/.gitignore @@ -136,7 +136,9 @@ wandb/ secrets.toml # VScode settings -.vscode/ +.vscode/* +!.vscode/extensions.json +!.vscode/settings.default.json .DS_Store diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..5d21c814da --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "charliermarsh.ruff" + ] +} diff --git a/.vscode/settings.default.json b/.vscode/settings.default.json new file mode 100644 index 0000000000..779291ff40 --- /dev/null +++ b/.vscode/settings.default.json @@ -0,0 +1,8 @@ +{ + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.codeActionsOnSave": { + "notebook.source.fixAll": "explicit", + // uncomment this if you don't want the editor to automatically organize imports + // "source.organizeImports": "never" + } +} \ No newline at end of file diff --git a/docs/setup.md b/docs/setup.md index 69b4f6ed50..0730197faa 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -252,14 +252,16 @@ If you also need to install the community features, run: poetry install --with community ``` -The codebase is formatted and linted using [Ruff](https://docs.astral.sh/ruff/). +The codebase is formatted and linted using [Ruff](https://docs.astral.sh/ruff/). To check for linter and formatter errors, run + ``` make lint ``` To apply automatic fixes, run + ``` make lint-fix ``` @@ -271,11 +273,17 @@ Run type checker: - Run with `pyright` - Configure in [pyproject.toml](../pyproject.toml) under `[tool.pyright]` +### VSCode recommendations + +- Install the [Ruff VSCode Extension](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff) +- Copy the contents of `.vscode/settings.default.json` into `.vscode/settings.json` + ## Setting up the Environment Variables **Please confirm that you have at least one configuration of the Cohere Platform, SageMaker, Bedrock or Azure.** You have two methods to set up the environment variables: + 1. Run `make setup` and follow the instructions to configure it. 2. Copy the contents of `configuration.template.yaml` and `secrets.template.yaml` files to new `configuration.yaml` and `secrets.yaml` files.