rename: archdoc → wtismycode (WTIsMyCode)
This commit is contained in:
73
wtismycode-core/tests/golden/test_project/ARCHITECTURE.md
Normal file
73
wtismycode-core/tests/golden/test_project/ARCHITECTURE.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# ARCHITECTURE — New Project
|
||||
|
||||
<!-- MANUAL:BEGIN -->
|
||||
## Project summary
|
||||
**Name:** New Project
|
||||
**Description:** <FILL_MANUALLY: what this project does in 3–7 lines>
|
||||
|
||||
## Key decisions (manual)
|
||||
- <FILL_MANUALLY>
|
||||
|
||||
## Non-goals (manual)
|
||||
- <FILL_MANUALLY>
|
||||
<!-- MANUAL:END -->
|
||||
|
||||
---
|
||||
|
||||
## Document metadata
|
||||
- **Created:** 2026-01-25
|
||||
- **Updated:** 2026-01-25
|
||||
- **Generated by:** wtismycode (cli) v0.1
|
||||
|
||||
---
|
||||
|
||||
## Rails / Tooling
|
||||
<!-- ARCHDOC:BEGIN section=rails -->
|
||||
|
||||
No tooling information available.
|
||||
<!-- ARCHDOC:END section=rails -->
|
||||
|
||||
---
|
||||
|
||||
## Repository layout (top-level)
|
||||
<!-- ARCHDOC:BEGIN section=layout -->
|
||||
|
||||
| Path | Purpose | Link |
|
||||
|------|---------|------|
|
||||
| ./src/advanced_example.py | Source file | [details](docs/architecture/files/._src_advanced_example.py.md) |
|
||||
| ./src/example.py | Source file | [details](docs/architecture/files/._src_example.py.md) |
|
||||
<!-- ARCHDOC:END section=layout -->
|
||||
|
||||
---
|
||||
|
||||
## Modules index
|
||||
<!-- ARCHDOC:BEGIN section=modules_index -->
|
||||
|
||||
| Module | Symbols | Inbound | Outbound | Link |
|
||||
|--------|---------|---------|----------|------|
|
||||
| ./src/advanced_example.py | 10 | 0 | 0 | [details](docs/architecture/modules/._src_advanced_example.py.md) |
|
||||
| ./src/example.py | 5 | 0 | 0 | [details](docs/architecture/modules/._src_example.py.md) |
|
||||
<!-- ARCHDOC:END section=modules_index -->
|
||||
|
||||
---
|
||||
|
||||
## Critical dependency points
|
||||
<!-- ARCHDOC:BEGIN section=critical_points -->
|
||||
|
||||
### High Fan-in (Most Called)
|
||||
| Symbol | Fan-in | Critical |
|
||||
|--------|--------|----------|
|
||||
|
||||
### High Fan-out (Calls Many)
|
||||
| Symbol | Fan-out | Critical |
|
||||
|--------|---------|----------|
|
||||
|
||||
### Module Cycles
|
||||
<!-- ARCHDOC:END section=critical_points -->
|
||||
|
||||
---
|
||||
|
||||
<!-- MANUAL:BEGIN -->
|
||||
## Change notes (manual)
|
||||
- <FILL_MANUALLY>
|
||||
<!-- MANUAL:END -->
|
||||
@@ -0,0 +1,3 @@
|
||||
# File: ./src/advanced_example.py
|
||||
|
||||
TODO: Add file documentation
|
||||
@@ -0,0 +1,3 @@
|
||||
# File: ./src/example.py
|
||||
|
||||
TODO: Add file documentation
|
||||
@@ -0,0 +1,3 @@
|
||||
# Module: ./src/advanced_example.py
|
||||
|
||||
TODO: Add module documentation
|
||||
@@ -0,0 +1,3 @@
|
||||
# Module: ./src/example.py
|
||||
|
||||
TODO: Add module documentation
|
||||
@@ -0,0 +1,107 @@
|
||||
"""Advanced example module for testing with integrations."""
|
||||
|
||||
import requests
|
||||
import sqlite3
|
||||
import redis
|
||||
from typing import List, Dict
|
||||
|
||||
class UserService:
|
||||
"""A service for managing users with database integration."""
|
||||
|
||||
def __init__(self, db_path: str = "users.db"):
|
||||
"""Initialize the user service with database path."""
|
||||
self.db_path = db_path
|
||||
self._init_db()
|
||||
|
||||
def _init_db(self):
|
||||
"""Initialize the database."""
|
||||
conn = sqlite3.connect(self.db_path)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
id INTEGER PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
email TEXT UNIQUE NOT NULL
|
||||
)
|
||||
""")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
def create_user(self, name: str, email: str) -> Dict:
|
||||
"""Create a new user in the database."""
|
||||
conn = sqlite3.connect(self.db_path)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
"INSERT INTO users (name, email) VALUES (?, ?)",
|
||||
(name, email)
|
||||
)
|
||||
user_id = cursor.lastrowid
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
return {"id": user_id, "name": name, "email": email}
|
||||
|
||||
def get_user(self, user_id: int) -> Dict:
|
||||
"""Get a user by ID from the database."""
|
||||
conn = sqlite3.connect(self.db_path)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))
|
||||
row = cursor.fetchone()
|
||||
conn.close()
|
||||
|
||||
if row:
|
||||
return {"id": row[0], "name": row[1], "email": row[2]}
|
||||
return None
|
||||
|
||||
class NotificationService:
|
||||
"""A service for sending notifications with queue integration."""
|
||||
|
||||
def __init__(self, redis_url: str = "redis://localhost:6379"):
|
||||
"""Initialize the notification service with Redis URL."""
|
||||
self.redis_client = redis.Redis.from_url(redis_url)
|
||||
|
||||
def send_email_notification(self, user_id: int, message: str) -> bool:
|
||||
"""Send an email notification by queuing it."""
|
||||
notification = {
|
||||
"user_id": user_id,
|
||||
"message": message,
|
||||
"type": "email"
|
||||
}
|
||||
|
||||
# Push to Redis queue
|
||||
self.redis_client.lpush("notifications", str(notification))
|
||||
return True
|
||||
|
||||
def fetch_external_user_data(user_id: int) -> Dict:
|
||||
"""Fetch user data from an external API."""
|
||||
response = requests.get(f"https://api.example.com/users/{user_id}")
|
||||
if response.status_code == 200:
|
||||
return response.json()
|
||||
return {}
|
||||
|
||||
def process_users(user_ids: List[int]) -> List[Dict]:
|
||||
"""Process a list of users with various integrations."""
|
||||
# Database integration
|
||||
user_service = UserService()
|
||||
|
||||
# Queue integration
|
||||
notification_service = NotificationService()
|
||||
|
||||
results = []
|
||||
for user_id in user_ids:
|
||||
# Database operation
|
||||
user = user_service.get_user(user_id)
|
||||
if user:
|
||||
# External API integration
|
||||
external_data = fetch_external_user_data(user_id)
|
||||
user.update(external_data)
|
||||
|
||||
# Queue operation
|
||||
notification_service.send_email_notification(
|
||||
user_id,
|
||||
f"Processing user {user['name']}"
|
||||
)
|
||||
|
||||
results.append(user)
|
||||
|
||||
return results
|
||||
29
wtismycode-core/tests/golden/test_project/src/example.py
Normal file
29
wtismycode-core/tests/golden/test_project/src/example.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""Example module for testing."""
|
||||
|
||||
import os
|
||||
from typing import List
|
||||
|
||||
class Calculator:
|
||||
"""A simple calculator class."""
|
||||
|
||||
def __init__(self):
|
||||
"""Initialize the calculator."""
|
||||
pass
|
||||
|
||||
def add(self, a: int, b: int) -> int:
|
||||
"""Add two numbers."""
|
||||
return a + b
|
||||
|
||||
def multiply(self, a: int, b: int) -> int:
|
||||
"""Multiply two numbers."""
|
||||
return a * b
|
||||
|
||||
def process_numbers(numbers: List[int]) -> List[int]:
|
||||
"""Process a list of numbers."""
|
||||
calc = Calculator()
|
||||
return [calc.add(n, 1) for n in numbers]
|
||||
|
||||
if __name__ == "__main__":
|
||||
numbers = [1, 2, 3, 4, 5]
|
||||
result = process_numbers(numbers)
|
||||
print(f"Processed numbers: {result}")
|
||||
62
wtismycode-core/tests/golden/test_project/wtismycode.toml
Normal file
62
wtismycode-core/tests/golden/test_project/wtismycode.toml
Normal file
@@ -0,0 +1,62 @@
|
||||
[project]
|
||||
root = "."
|
||||
out_dir = "docs/architecture"
|
||||
entry_file = "ARCHITECTURE.md"
|
||||
language = "python"
|
||||
|
||||
[scan]
|
||||
include = ["src", "app", "tests"]
|
||||
exclude = [
|
||||
".venv", "venv", "__pycache__", ".git", "dist", "build",
|
||||
".mypy_cache", ".ruff_cache", ".pytest_cache", "*.egg-info"
|
||||
]
|
||||
follow_symlinks = false
|
||||
max_file_size = "10MB"
|
||||
|
||||
[python]
|
||||
src_roots = ["src", "."]
|
||||
include_tests = true
|
||||
parse_docstrings = true
|
||||
max_parse_errors = 10
|
||||
|
||||
[analysis]
|
||||
resolve_calls = true
|
||||
resolve_inheritance = false
|
||||
detect_integrations = true
|
||||
integration_patterns = [
|
||||
{ type = "http", patterns = ["requests", "httpx", "aiohttp"] },
|
||||
{ type = "db", patterns = ["sqlalchemy", "psycopg", "mysql", "sqlite3"] },
|
||||
{ type = "queue", patterns = ["celery", "kafka", "pika", "redis"] }
|
||||
]
|
||||
|
||||
[output]
|
||||
single_file = false
|
||||
per_file_docs = true
|
||||
create_directories = true
|
||||
overwrite_manual_sections = false
|
||||
|
||||
[diff]
|
||||
update_timestamp_on_change_only = true
|
||||
hash_algorithm = "sha256"
|
||||
preserve_manual_content = true
|
||||
|
||||
[thresholds]
|
||||
critical_fan_in = 20
|
||||
critical_fan_out = 20
|
||||
high_complexity = 50
|
||||
|
||||
[rendering]
|
||||
template_engine = "handlebars"
|
||||
max_table_rows = 100
|
||||
truncate_long_descriptions = true
|
||||
description_max_length = 200
|
||||
|
||||
[logging]
|
||||
level = "info"
|
||||
file = "wtismycode.log"
|
||||
format = "compact"
|
||||
|
||||
[caching]
|
||||
enabled = true
|
||||
cache_dir = ".wtismycode/cache"
|
||||
max_cache_age = "24h"
|
||||
Reference in New Issue
Block a user