Skip to content

Commit 93f4586

Browse files
committed
docs: update CLI and examples for snapshot save/check workflow
1 parent 7410b83 commit 93f4586

4 files changed

Lines changed: 29 additions & 8 deletions

File tree

docs/ci-integration.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,23 @@ repos:
221221
Add Pacta to your Makefile for easy local runs:
222222

223223
```makefile
224-
.PHONY: arch arch-baseline
224+
.PHONY: arch arch-snapshot arch-check arch-baseline arch-ci
225225
226-
# Run architecture check
226+
# Full scan (snapshot + check in one step)
227227
arch:
228228
pacta scan . --model architecture.yml --rules rules.pacta.yml
229229
230+
# Two-step workflow
231+
arch-snapshot:
232+
pacta snapshot save . --model architecture.yml
233+
234+
arch-check:
235+
pacta check . --rules rules.pacta.yml
236+
230237
# Update baseline
231238
arch-baseline:
232-
pacta scan . --model architecture.yml --rules rules.pacta.yml --save-ref baseline
239+
pacta snapshot save . --model architecture.yml --ref baseline
240+
pacta check . --ref baseline --rules rules.pacta.yml
233241
234242
# Check against baseline (CI mode)
235243
arch-ci:

docs/cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ Violations are displayed with human-readable explanations:
6363

6464
## check
6565

66-
Evaluate architectural rules against an existing snapshot.
66+
Evaluate architectural rules against an existing snapshot and write violations back into it.
6767

68-
This separates the "capture" step (`snapshot save`) from the "verify" step (`check`), allowing you to snapshot your architecture once and check it against different rule sets or at different times.
68+
This separates the "capture" step (`snapshot save`) from the "verify" step (`check`), allowing you to snapshot your architecture once and check it against different rule sets or at different times. The existing snapshot object is updated in-place — no new snapshot is created.
6969

7070
```bash
7171
pacta check [PATH] [OPTIONS]

docs/getting-started.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ containers:
3838
Now capture a snapshot:
3939
4040
```bash
41-
pacta snapshot . --model architecture.yml
41+
pacta snapshot save . --model architecture.yml
4242
```
4343

4444
Pacta just analyzed every module and dependency in your codebase and stored a content-addressed snapshot in `.pacta/`. This snapshot is immutable — a permanent record of your architecture at this moment.
@@ -50,7 +50,7 @@ Pacta just analyzed every module and dependency in your codebase and stored a co
5050
A week passes. Your team ships features, fixes bugs, refactors code. Run another snapshot:
5151

5252
```bash
53-
pacta snapshot . --model architecture.yml
53+
pacta snapshot save . --model architecture.yml
5454
```
5555

5656
Now you have two points in time. See what changed:
@@ -149,12 +149,19 @@ Two violations. But wait — this is a legacy codebase. You can't fix everything
149149
Save the current state as a baseline:
150150

151151
```bash
152+
# One-step:
152153
pacta scan . --model architecture.yml --rules rules.pacta.yml --save-ref baseline
154+
155+
# Or two-step:
156+
pacta snapshot save . --model architecture.yml --ref baseline
157+
pacta check . --ref baseline --rules rules.pacta.yml
153158
```
154159

155-
Now future scans compare against this baseline:
160+
Now future checks compare against this baseline:
156161

157162
```bash
163+
pacta check . --rules rules.pacta.yml --baseline baseline
164+
# Or equivalently:
158165
pacta scan . --model architecture.yml --rules rules.pacta.yml --baseline baseline
159166
```
160167

examples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ To run any example:
2222

2323
```bash
2424
cd examples/<example-name>
25+
26+
# One-step (scan = snapshot + check):
2527
pacta scan . --model architecture.yml --rules rules.pacta.yml
28+
29+
# Or two-step:
30+
pacta snapshot save . --model architecture.yml
31+
pacta check . --rules rules.pacta.yml
2632
```
2733

2834
## Creating Your Own

0 commit comments

Comments
 (0)