Skip to content

Commit 93cca02

Browse files
authored
Merge pull request #1 from damassi/feat/ci
feat: add ci runner
2 parents 24c5d4e + 09b4197 commit 93cca02

File tree

4 files changed

+40
-8
lines changed

4 files changed

+40
-8
lines changed

.github/workflows/type-check.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Type Check
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
type-check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.12"
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v4
18+
19+
- name: Run mypy
20+
run: uv run mypy src/agent_chat_cli

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
# CLAUDE.md System Settings
1+
# CLAUDE.md System Prompt
22

33
## Rules
44

55
- The project uses `uv`, `ruff` and `mypy`
66
- Run commands should be prefixed with `uv`: `uv run ...`
77
- Use `asyncio` features, if such is needed
8+
- Absolutely no useless comments! Every class and method does not need to be documented (unless it is legitimetly complex or "lib-ish")

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ This app uses [uv](https://github.com/astral-sh/uv) for package management so fi
1919
- `uv run chat`
2020

2121
Additional MCP servers are configured in `agent-chat-cli.config.yaml` and prompts added within the `prompts` folder.
22+
23+
## Development
24+
25+
- Install pre-commit hooks
26+
- `uv run pre-commit install`
27+
- Typechecking is via [MyPy](https://github.com/python/mypy):
28+
- `uv run mypy src`
29+
- Linting and formatting is via [Ruff](https://docs.astral.sh/ruff/)

src/agent_chat_cli/utils/config.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,34 +57,37 @@ def load_config(
5757
raw_config = yaml.safe_load(f)
5858

5959
base_system_prompt = ""
60-
if "system_prompt" in raw_config:
60+
61+
if raw_config.get("system_prompt"):
6162
base_system_prompt = load_prompt(raw_config["system_prompt"])
6263

63-
if "agents" in raw_config:
64+
if raw_config.get("agents"):
6465
for agent_config in raw_config["agents"].values():
65-
if "prompt" in agent_config:
66+
if agent_config.get("prompt"):
6667
agent_config["prompt"] = load_prompt(agent_config["prompt"])
6768

6869
mcp_server_prompts = []
69-
if "mcp_servers" in raw_config:
70+
71+
if raw_config.get("mcp_servers"):
7072
enabled_servers = {
7173
name: config
7274
for name, config in raw_config["mcp_servers"].items()
7375
if config.get("enabled", True)
7476
}
77+
7578
raw_config["mcp_servers"] = enabled_servers
7679

7780
for server_config in enabled_servers.values():
78-
if "prompt" in server_config and server_config["prompt"]:
81+
if server_config.get("prompt"):
7982
loaded_prompt = load_prompt(server_config["prompt"])
8083
server_config["prompt"] = loaded_prompt
8184
mcp_server_prompts.append(loaded_prompt)
8285

83-
if "env" in server_config:
86+
if server_config.get("env"):
8487
for key, value in server_config["env"].items():
8588
server_config["env"][key] = os.path.expandvars(value)
8689

87-
if "args" in server_config:
90+
if server_config.get("args"):
8891
server_config["args"] = [
8992
os.path.expandvars(arg) for arg in server_config["args"]
9093
]

0 commit comments

Comments
 (0)