Skip to content
Merged
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
23 changes: 23 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: mypy

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set up environment
run: |
bash venv.sh
- name: Analysing the code with mypy
run: |
. .venv/bin/activate
mypy bot/TypoBot.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ config.py
__pycache__/
.venv/
storage.json
.mypy_cache/
5 changes: 3 additions & 2 deletions venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ function activate {
source $VENV_DIR/bin/activate
}

if [[ ! -f "$CONFIG_FILE" ]] then
if [ ! -f "$CONFIG_FILE" ]; then
# Create example config file
echo "DISCORD_TOKEN = \"token here\"" >> $CONFIG_FILE
echo "STORAGE_FILE = \"storage.json\"" >> $CONFIG_FILE
echo "STARBOARD_CHANNEL_ID = \"0000000000000000000\"" >> $CONFIG_FILE
echo "STARBOARD_MINIMUM_STARS = 5" >> $CONFIG_FILE
fi

if [[ ! -d "$VENV_DIR" ]] then
if [ ! -d "$VENV_DIR" ]; then
# Create virtual environment and install required packages
$PYTHON -m venv "$VENV_DIR"
activate
pip install --upgrade pip
pip install -r "$REQUIREMENTS"
else
activate
Expand Down