Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ venv.bak/
.mypy_cache/

# IDE and Editors
.vscode/
.idea/

# MACOS Files and Property file
Expand Down
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -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"
],
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"python.defaultInterpreterPath": ".venv\\Scripts\\python.exe",
"python.analysis.extraPaths": ["bot"],
}
35 changes: 35 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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": [],
}
]
}
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 <name of new remote branch>`

## Set up the Development Environment With an Editor

### 1. VSCode
<img src="assets/task.png"></img>

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

Expand Down
Binary file added assets/task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.