Skip to content

Contributing

Thank you for your interest in contributing to warrior-bot!

Development Setup

  1. Clone the repository:
git clone https://github.com/yourusername/warrior-bot.git
cd warrior-bot
  1. Create a virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install development dependencies:
pip install -r requirements-dev.txt
pip install -e .
  1. Set up pre-commit hooks:
pre-commit install

Code Standards

We use several tools to maintain code quality:

  • black: Code formatting
  • isort: Import sorting
  • flake8: Linting
  • mypy: Type checking

Run all checks:

black warrior_bot/
isort warrior_bot/
flake8 warrior_bot/
mypy warrior_bot/

Or let pre-commit handle it automatically when you commit.

Adding a New Command

  1. Create a new folder in warrior_bot/commands/:
mkdir warrior_bot/commands/mycommand
  1. Create __init__.py with your command:
"""My command implementation."""

import click


@click.command()
def mycommand():
    """My command description."""
    click.echo("Hello from mycommand!")
  1. Register it in warrior_bot/cli.py:
from warrior_bot.commands import mycommand

# In the cli function:
cli.add_command(mycommand.mycommand)

Documentation

Update the docs when adding features:

  1. Edit files in the docs/ directory
  2. Preview locally:
mkdocs serve
  1. Visit http://127.0.0.1:8000 to see your changes

Submitting Changes

  1. Create a new branch:
git checkout -b feature/my-feature
  1. Make your changes and commit:
git add .
git commit -m "Add my feature"
  1. Push and create a pull request:
git push origin feature/my-feature

Questions?

Feel free to open an issue if you have questions!