Skip to content

Latest commit

 

History

History
156 lines (112 loc) · 3.24 KB

File metadata and controls

156 lines (112 loc) · 3.24 KB

Contributing

SQL Query Generator is an open-source project for natural language to SQL conversion using IBM WatsonX.

Before You Start

Read the README.md to understand the project architecture.

Style and Lint

This project uses the same tools as BeeAI Framework:

Setting Up Development Environment

Option 1: Using Mise (Recommended)

Mise-en-place manages tool versions and runs tasks:

# Install mise
curl https://mise.run | sh

# Trust and install tools
mise trust
mise install

# List available tasks
mise run

Option 2: Manual Setup

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt

# Install pre-commit hooks
pre-commit install

Available Tasks (Mise)

Task Description
mise run Run Streamlit app
mise check Run format check + lint
mise fix Fix formatting and lint issues
mise format Format code with Black
mise lint Lint code with Ruff
mise test Run tests
mise commit Interactive conventional commit

Manual Commands

# Format code
black .

# Check formatting
black --check --diff .

# Lint
ruff check .

# Fix lint issues
ruff check --fix .

# Run tests
python -m pytest tests/ -v

Conventional Commits

We use Conventional Commits for commit messages:

<type>(<scope>): <subject>

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation
  • style: Formatting (no code change)
  • refactor: Code refactoring
  • perf: Performance improvement
  • test: Tests
  • chore: Maintenance

Scopes

  • agent: Agent modules (beeai, langchain, self-improving)
  • classifier: Query classification
  • learning: Self-improving/learning store
  • ui: Streamlit UI
  • db: Database operations
  • docs: Documentation

Examples

feat(agent): add context awareness for follow-up queries
fix(classifier): prevent false positives for common words
docs(readme): update installation instructions
perf(learning): add embedding cache for faster lookups

Using Commitizen

# Interactive commit
cz commit

# Or with mise
mise commit

Pre-commit Hooks

Pre-commit hooks run automatically on git commit:

  1. Black - Formats code
  2. Ruff - Lints and fixes issues
  3. Commitizen - Validates commit message format

To skip hooks (not recommended):

git commit --no-verify -m "message"

Pull Request Process

  1. Create a feature branch: git checkout -b feat/my-feature
  2. Make changes and commit using conventional commits
  3. Ensure all checks pass: mise check
  4. Push and create PR

Code Quality Standards

  • Line length: 120 characters
  • Python version: 3.10+
  • All code must pass Black formatting
  • All code must pass Ruff linting
  • Tests should pass before merging

License

MIT License - See LICENSE for details.