diff --git a/.gitignore b/.gitignore index 46a44bf5..c0c60dfa 100644 --- a/.gitignore +++ b/.gitignore @@ -104,7 +104,6 @@ venv.bak/ .mypy_cache/ # IDE and Editors -.vscode/ .idea/ # MACOS Files and Property file diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..bb7639aa --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,11 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "ms-python.python", + "ms-python.vscode-pylance", + "njpwerner.autodocstring" + ], +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..1aeac5eb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "python.defaultInterpreterPath": ".venv\\Scripts\\python.exe", + "python.analysis.extraPaths": ["bot"], +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..355c0ed4 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,35 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Setup", + "type": "shell", + "command": "poetry install && poetry run task precommit && poetry run pre-commit run --all-files", + "problemMatcher": [] + }, + { + "label": "Run Bot With Docker", + "type": "shell", + "command": "docker-compose up", + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Build and Run Bot With Docker", + "type": "shell", + "command": "docker-compose up --build", + "problemMatcher": [], + }, + { + "label": "Run Bot Manually", + "type": "shell", + "command": "poetry run task bot", + "problemMatcher": [], + } + ] +} diff --git a/README.md b/README.md index d8f8183f..e55faf4b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Then navigate to the directory `cd gurkbot/` PREFIX = "!" # the prefix the bot should use, will default to "!" if this is not present ``` -4. Install poetry: `pip install -U poetry` and run the following: +4. [Install poetry](https://python-poetry.org/docs/#installation) and run the following: ```sh # This will install the development and project dependencies. @@ -49,8 +49,20 @@ Then navigate to the directory `cd gurkbot/` poetry run task bot ``` + 5. Lint and format your code properly using `poetry run task lint`, and push changes `git push -u origin ` +## Set up the Development Environment With an Editor + +### 1. VSCode + + +1. Run the setup task by pressing `Ctrl + P` and typing `task Setup` + +2. Run the bot in development using any of the `Run Bot` tasks (You can run them just like the +`Setup` task in the previous step). You can also run the default build task +by pressing `Ctrl + Shift + B` + ## Commands to Remember `poetry run task precommit` - Installs the pre-commit git hook diff --git a/assets/task.png b/assets/task.png new file mode 100644 index 00000000..3b9274a6 Binary files /dev/null and b/assets/task.png differ diff --git a/docker-compose.yaml b/docker-compose.yml similarity index 100% rename from docker-compose.yaml rename to docker-compose.yml