Skip to content

Commit

Permalink
Update diff mode doc (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
hahwul committed Jul 14, 2024
1 parent 2439c26 commit 4c59882
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/_advanced/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,19 @@ nav_order: 4
layout: page
---

Diff mode is a feature that analyzes and compares two source code paths using noir, enabling you to identify newly added, modified, or removed APIs. The base path specified with the `-b` flag serves as the reference point, while the source input provided with the `--diff-path` flag is used for comparison.

```bash
noir -b <BASE_PATH> --diff-paht <OLD_APP>
noir -b <BASE_PATH> --diff-path <OLD_APP>

# DIFF:
# --diff-path ./app2 Specify the path to the old version of the source code for comparison
```

## Plain output

In plain output, changes to the APIs are briefly summarized.

```
[*] ============== DIFF ==============
[I] Added: / GET
Expand All @@ -26,7 +30,9 @@ noir -b <BASE_PATH> --diff-paht <OLD_APP>
[I] Removed: /posts/1 DELETE
```

## JSON
## JSON & YAML

In contrast, detailed information is provided in JSON or YAML output. (with `-f=json` or `-f=yaml` )

```json
{
Expand Down Expand Up @@ -110,4 +116,6 @@ noir -b <BASE_PATH> --diff-paht <OLD_APP>
],
"changed": []
}
```
```

By utilizing this feature, you can build a more efficient pipeline, such as configuring DAST scans to target only added or modified APIs.

0 comments on commit 4c59882

Please sign in to comment.