Configuration
Splat can be configured through environment variables, pyproject.toml, or programmatically.
Configuration Precedence
Configuration is loaded in this order (highest priority first):
Programmatic - Parameters passed to
Splat(),SplatMiddleware, orSplatFlaskpyproject.toml -
[tool.splat]sectionEnvironment variables -
SPLAT_*variablesDefaults - Built-in defaults
Required Settings
Setting |
Description |
|---|---|
|
GitHub repository in |
|
GitHub API token with |
All Options
Setting |
Type |
Default |
Description |
|---|---|---|---|
|
string |
- |
GitHub repository ( |
|
string |
- |
GitHub API token |
|
boolean |
|
Enable/disable error reporting |
|
list |
|
Labels applied to created issues |
|
integer |
|
Number of log entries to capture |
|
boolean |
|
Enable debug logging |
Environment Variables
SPLAT_GITHUB_REPO=owner/repo
SPLAT_GITHUB_TOKEN=ghp_xxxxxxxxxxxx
SPLAT_ENABLED=true
SPLAT_LABELS=bug,splat,auto-fix
SPLAT_LOG_BUFFER_SIZE=200
SPLAT_DEBUG=false
Note
For SPLAT_LABELS, use comma-separated values (e.g., bug,splat,auto-fix).
pyproject.toml
[tool.splat]
repo = "owner/repo"
enabled = true
labels = ["bug", "splat", "auto-fix"]
log_buffer_size = 200
debug = false
Warning
Don’t commit tokens to pyproject.toml. Use environment variables for secrets.
Programmatic Configuration
FastAPI:
from fastapi import FastAPI
from splat.middleware.fastapi import SplatMiddleware
app = FastAPI()
app.add_middleware(
SplatMiddleware,
repo="owner/repo",
token="ghp_xxxxxxxxxxxx",
labels=["bug", "splat", "auto-fix"],
log_buffer_size=500,
debug=True,
)
Flask:
from flask import Flask
from splat.middleware.flask import SplatFlask
app = Flask(__name__)
splat = SplatFlask(
app,
repo="owner/repo",
token="ghp_xxxxxxxxxxxx",
labels=["bug", "splat", "auto-fix"],
log_buffer_size=500,
debug=True,
)
New in v1.0.0
API Configuration
Setting |
Type |
Default |
Description |
|---|---|---|---|
|
float |
|
API request timeout in seconds |
|
string |
|
GitHub API base URL (for Enterprise) |
Exception Filtering (Programmatic Only)
Setting |
Type |
Default |
Description |
|---|---|---|---|
|
list |
|
Exception types to ignore |
|
callable |
|
Custom filter callback |
Example:
app.add_middleware(
SplatMiddleware,
ignore_exceptions=[ValueError, KeyError],
exception_filter=lambda e: not isinstance(e, HTTPException),
)
Environment Variables
SPLAT_TIMEOUT=30.0
SPLAT_GITHUB_API_URL=https://github.example.com/api/v3
GitHub Enterprise
To use with GitHub Enterprise:
app.add_middleware(
SplatMiddleware,
github_api_url="https://github.mycompany.com/api/v3",
)
Or via environment:
SPLAT_GITHUB_API_URL=https://github.mycompany.com/api/v3
Disabling Splat
To temporarily disable error reporting:
SPLAT_ENABLED=false
Or programmatically:
app.add_middleware(SplatMiddleware, enabled=False)
Debug Mode
Enable debug mode to see Splat’s internal operations:
SPLAT_DEBUG=true
This logs information about:
Configuration loading
Error detection and deduplication
GitHub API calls
Issue creation