Skip to content

Commit 3673968

Browse files
committed
Add mkdocs, update readme and supported version info
1 parent 26ef7ff commit 3673968

File tree

13 files changed

+1186
-2
lines changed

13 files changed

+1186
-2
lines changed
File renamed without changes.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
<p align="center">
66
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"></a>
7-
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.12+-blue.svg" alt="Python 3.12+"></a>
7+
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="Python 3.10+"></a>
8+
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/status-alpha%200.0.1a2-orange.svg" alt="Status Alpha"></a>
89
</p>
910

1011

docs/docs/assets/logo-full.svg

Lines changed: 109 additions & 0 deletions
Loading

docs/docs/assets/logo.svg

Lines changed: 86 additions & 0 deletions
Loading

docs/docs/changelog.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
All notable changes are documented here.
4+
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5+
Versioning: [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
---
8+
9+
## [0.0.1a2] — 2026-02-19
10+
11+
### Added
12+
13+
- `pyarchrules check` — validates architecture from the CLI
14+
- `pyarchrules init-project` — initialises `pyproject.toml` config
15+
- `pyarchrules add-service` / `remove-service` / `list-services` commands
16+
- `TreeRule` — validates directory tree structure
17+
- `DependenciesRule` — validates internal module import direction
18+
- `AllowedServiceDependenciesRule` — validates cross-service imports
19+
- `MustContainFoldersRule` DSL rule with `allow_extra` parameter
20+
- `PyArchRules` Python API with `for_service()` / `validate()` interface
21+
- `PyArchConfig` for reading/writing `pyproject.toml` via `tomlkit`
22+
- Pydantic-backed `ProjectSpec` and `ServiceSpec` models
23+
- `ConsoleViolationReporter` for human-readable output
24+
- `RuleEvalResult` with `is_valid`, `error_count`, `warning_count`
25+
26+
> ⚠️ **Alpha** — API may change before 1.0.
27+
28+
---
29+
30+
## [0.0.1a1] — 2026-01-01
31+
32+
Initial private release.

docs/docs/cli.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
# CLI Reference
2+
3+
```bash
4+
pyarchrules --help
5+
```
6+
7+
## Commands
8+
9+
| Command | Description |
10+
|---------|-------------|
11+
| `init-project` | Initialise `[tool.pyarchrules]` in `pyproject.toml` |
12+
| `add-service` | Register a new service |
13+
| `remove-service` | Remove a service |
14+
| `list-services` | Show all configured services |
15+
| `check` | Validate architecture against all rules |
16+
17+
---
18+
19+
## `init-project`
20+
21+
```bash
22+
pyarchrules init-project [PROJECT_ROOT] [--force]
23+
```
24+
25+
Writes a default `[tool.pyarchrules]` section to `pyproject.toml`.
26+
27+
| Argument / Option | Default | Description |
28+
|-------------------|---------|-------------|
29+
| `PROJECT_ROOT` | `.` | Path to the project root. |
30+
| `--force`, `-f` | false | Re-initialise without confirmation. |
31+
32+
**Output:**
33+
34+
```
35+
✨ Successfully initialized!
36+
📝 /home/user/myapp/pyproject.toml
37+
38+
Configuration:
39+
• root = '.'
40+
• strict = true
41+
• validate_paths = true
42+
• fail_on_warning = false
43+
```
44+
45+
Exit codes: `0` success · `1` `pyproject.toml` not found
46+
47+
---
48+
49+
## `add-service`
50+
51+
```bash
52+
pyarchrules add-service [NAME] [PATH]
53+
```
54+
55+
Adds or updates a service. Prompts interactively if arguments are omitted.
56+
57+
```bash
58+
pyarchrules add-service backend src/backend
59+
pyarchrules add-service # interactive prompts
60+
```
61+
62+
**Output:**
63+
64+
```
65+
➕ Added service 'backend'
66+
Path: src/backend
67+
```
68+
69+
Exit codes: `0` success · `1` invalid name or config not found
70+
71+
---
72+
73+
## `remove-service`
74+
75+
```bash
76+
pyarchrules remove-service [NAME] [--force]
77+
```
78+
79+
Removes a service. Prompts for confirmation unless `--force`.
80+
81+
```bash
82+
pyarchrules remove-service backend --force
83+
pyarchrules remove-service # interactive list
84+
```
85+
86+
Exit codes: `0` success or cancelled · `1` service not found
87+
88+
---
89+
90+
## `list-services`
91+
92+
```bash
93+
pyarchrules list-services
94+
```
95+
96+
**Output:**
97+
98+
```
99+
📦 Configured services (3):
100+
101+
• backend
102+
src/backend
103+
• auth
104+
services/auth
105+
• shared
106+
services/shared
107+
```
108+
109+
---
110+
111+
## `check`
112+
113+
```bash
114+
pyarchrules check [PROJECT_ROOT] [--strict/--no-strict] [--verbose/--quiet]
115+
```
116+
117+
Validates architecture against all rules in `pyproject.toml`.
118+
119+
| Option | Default | Description |
120+
|--------|---------|-------------|
121+
| `--strict` / `--no-strict` | from config | Override strict mode. |
122+
| `--verbose` / `--quiet` | `--verbose` | Show per-service rule detail. |
123+
124+
**Passing:**
125+
126+
```
127+
🔍 Checking 2 service(s)...
128+
129+
📦 backend
130+
Path: src/backend
131+
Rules: tree_structure, internal_dependencies
132+
133+
✨ All checks passed!
134+
Checked 2 rule(s) across 2 service(s)
135+
```
136+
137+
**Failing:**
138+
139+
```
140+
❌ Validation failed!
141+
142+
Found 1 error(s) and 0 warning(s):
143+
144+
❌ [backend] tree_structure
145+
Missing required paths: ['domain']
146+
```
147+
148+
**Exit codes:**
149+
150+
| Code | Condition |
151+
|------|-----------|
152+
| `0` | All checks passed |
153+
| `0` | Violations present but `strict = false` |
154+
| `1` | Errors present and `strict = true` |
155+
| `1` | Warnings present and `fail_on_warning = true` |
156+
| `1` | Config could not be loaded |

0 commit comments

Comments
 (0)