Skip to content

Commit 436b389

Browse files
authored
Merge pull request #33 from ksylvan/0606-implement-run-pattern
Implement `fabric_run_pattern` Core with Testing Overhaul
2 parents 06c731b + 0f92c3c commit 436b389

24 files changed

+1713
-540
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ node_modules/
198198
.cursor
199199

200200
# As well as the generated PRD
201-
scripts
201+
scripts/*
202202

203203
# Logs
204204
logs

.vscode/mcp.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"servers": {
3+
"FabricMCP": {
4+
"type": "stdio",
5+
"command": "uv",
6+
"args": ["run", "fabric-mcp", "--transport", "stdio"],
7+
"cwd": "${workspaceFolder}"
8+
}
9+
}
10+
}

Makefile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# Makefile for
22
#
33

4-
.PHONY: _default bootstrap build clean coverage coverage-html \
5-
coverage-show dev format help lint mcp-inspector merge tag test test-fast test-serial
4+
.PHONY: __default _check_unused bootstrap build clean coverage coverage-html \
5+
coverage-show dev format help lint mcp-inspector merge tag \
6+
test test-fast test-serial vulture
67

78
COVERAGE_FAIL_UNDER := 90
89
PACKAGE_PATH := src/fabric_mcp
10+
TESTS_PATH := tests
11+
912

1013
# The node package manager could be npm, but why? pnpm is faster and more efficient
1114
# This is only needed if you are using the fastmcp dev server.
@@ -15,7 +18,10 @@ STDIO_SERVER_SRC_FOR_MCP_INSPECTOR := $(PACKAGE_PATH)/server_stdio.py
1518

1619
VERSION := $(shell uv run hatch version)
1720

18-
_default: help
21+
__default: help
22+
23+
_check_unused:
24+
uv run python tests/scripts/check_shared_utils
1925

2026
bootstrap:
2127
uv sync --dev
@@ -28,6 +34,8 @@ build:
2834

2935
clean:
3036
rm -rf .venv dist node_modules
37+
find $(PACKAGE_PATH) -name "*.pyc" -delete
38+
find $(TESTS_PATH) -name "*.pyc" -delete
3139

3240
coverage:
3341
uv run pytest -n auto --cov=$(PACKAGE_PATH) \
@@ -78,12 +86,13 @@ help:
7886
@echo " test Run tests with parallel execution"
7987
@echo " test-fast Run tests with optimized parallel execution (skips linting)"
8088
@echo " test-serial Run tests serially (single-threaded)"
89+
@echo " vulture Run Vulture to check for dead code and unused imports"
8190

82-
lint:
91+
lint: vulture
8392
uv run ruff format --check .
8493
uv run ruff check .
85-
uv run pylint --fail-on=W0718 $(PACKAGE_PATH) tests
86-
uv run pyright $(PACKAGE_PATH) tests
94+
uv run pylint --fail-on=W0718 $(PACKAGE_PATH) $(TESTS_PATH)
95+
uv run pyright $(PACKAGE_PATH) $(TESTS_PATH)
8796

8897
merge:
8998
@echo "This will merge develop into main and push to origin."
@@ -129,3 +138,7 @@ test-fast:
129138
test-serial: lint
130139
uv run pytest -v
131140

141+
# Vulture - static analysis for dead code
142+
# Also checks for unimported .py files in tests/shared/
143+
vulture: _check_unused
144+
uv run vulture

cspell.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
"delenv",
1616
"Dockerization",
1717
"docstrings",
18+
"elif",
1819
"excinfo",
20+
"fastapi",
1921
"forcelist",
2022
"grokai",
2123
"groq",
@@ -34,8 +36,10 @@
3436
"Miessler",
3537
"Miessler's",
3638
"modelcontextprotocol",
39+
"mypy",
3740
"ollama",
3841
"openrouter",
42+
"popleft",
3943
"pylint",
4044
"pylintrc",
4145
"pypi",
@@ -46,6 +50,7 @@
4650
"restapi",
4751
"sdist",
4852
"signum",
53+
"startswith",
4954
"Streamable",
5055
"testpypi",
5156
"toupper",

docs/contributing-cheatsheet.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ git checkout -b feature/my-change
1616

1717
# make changes
1818

19+
# Run tests and ensure coverage targets met
20+
# (testing also runs linters and the "vulture" tool)
21+
make test
22+
make coverage
23+
1924
git commit -m "feat: my changes" # ← Hooks run, ensure good practices
2025
git push -u origin feature/my-change
2126
```

docs/contributing-detailed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Contributors will primarily interact with the following tools, largely configure
136136
| `pylint` | Linting (additional checks) | `make lint` (`uv run pylint`) | `pyproject.toml` (or `.pylintrc`) |
137137
| `pytest` | Automated Testing | `make test` (`uv run pytest`) | `pyproject.toml` |
138138
| `pyright` | Static Type Checking | `make lint` (`uv run pyright`) | `pyproject.toml` |
139+
| `vulture` | Check for dead code, unused variables/functions | `make vulture` (`uv run vulture`) | `pyproject.toml` |
139140

140141
This table offers a consolidated summary, helping contributors quickly identify the main tools, their functions, common commands, and their configuration sources.
141142

docs/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ make dev # Start FastMCP dev server with MCP inspector
8080
make mcp-inspector # Start standalone MCP inspector
8181
make build # Build the project
8282
make clean # Remove build/test artifacts
83+
make vulture # Run the vulture tool (check for dead code)
8384
```
8485

8586
## Code Style and Quality

0 commit comments

Comments
 (0)