Skip to content

Commit 2e60cc4

Browse files
authored
Add output images (#113)
* Add 09_bans example * Add output examples, fixup code fences
1 parent b27e67d commit 2e60cc4

File tree

17 files changed

+1192
-16
lines changed

17 files changed

+1192
-16
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
[![Build Status](https://github.com/EmbarkStudios/cargo-deny/workflows/CI/badge.svg)](https://github.com/EmbarkStudios/cargo-deny/actions?workflow=CI)
44
[![Latest version](https://img.shields.io/crates/v/cargo-deny.svg)](https://crates.io/crates/cargo-deny)
5-
[![Docs](https://img.shields.io/badge/docs-The%20Book-green.svg)](https://embarkstudios.github.io/cargo-deny/)
5+
[![Docs](https://img.shields.io/badge/The%20Book-📕-brightgreen.svg)](https://embarkstudios.github.io/cargo-deny/)
66
[![API Docs](https://docs.rs/cargo-deny/badge.svg)](https://docs.rs/cargo-deny)
77
[![SPDX Version](https://img.shields.io/badge/SPDX%20Version-3.7-blue.svg)](https://spdx.org/licenses/)
88
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
99
[![Embark](https://img.shields.io/badge/embark-open%20source-blueviolet.svg)](http://embark.dev)
1010

11-
`cargo-deny` is a cargo plugin for linting your dependencies. See the [book 📖](https://embarkstudios.github.io/cargo-deny/) for in-depth documentation.
11+
`cargo-deny` is a cargo plugin for linting your dependencies. See the [book 📕](https://embarkstudios.github.io/cargo-deny/) for in-depth documentation.
1212

1313
To run on CI as a GitHub Action, see [`cargo-deny-action`](https://github.com/EmbarkStudios/cargo-deny-action).
1414

@@ -46,6 +46,8 @@ The licenses check is used to verify that every crate you use has license terms
4646
cargo deny check licenses
4747
```
4848

49+
<img src="https://imgur.com/XMmvx9L.png"/>
50+
4951
#### [Bans](https://embarkstudios.github.io/cargo-deny/checks/bans/index.html)
5052

5153
The bans check is used to deny (or allow) specific crates, as well as detect and handle multiple versions of the same crate.
@@ -54,6 +56,8 @@ The bans check is used to deny (or allow) specific crates, as well as detect and
5456
cargo deny check bans
5557
```
5658

59+
<img src="https://imgur.com/K3UeXcR.png"/>
60+
5761
#### [Advisories](https://embarkstudios.github.io/cargo-deny/checks/advisories/index.html)
5862

5963
The advisories check is used to detect issues for crates by looking in an advisory database.
@@ -62,6 +66,8 @@ The advisories check is used to detect issues for crates by looking in an adviso
6266
cargo deny check advisories
6367
```
6468

69+
<img src="https://imgur.com/FK50XLb.png"/>
70+
6571
#### [Sources](https://embarkstudios.github.io/cargo-deny/checks/sources/index.html)
6672

6773
The sources check ensures crates only come from sources you trust.
@@ -70,6 +76,8 @@ The sources check ensures crates only come from sources you trust.
7076
cargo deny check sources
7177
```
7278

79+
<img src="https://imgur.com/xdHFDWS.png"/>
80+
7381
## Contributing
7482

7583
We welcome community contributions to this project.

docs/src/checks/advisories/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
The advisories check is used to detect issues for crates by looking in an
44
advisory database.
55

6+
```bash
7+
cargo deny check advisories
8+
```
9+
10+
<img src="https://imgur.com/FK50XLb.png"/>
11+
612
## Use Case - Detecting security vulnerabilities
713

814
Security vulnerabilities are generally considered "not great" by most people,

docs/src/checks/bans/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
The bans check is used to deny (or allow) specific crates, as well as detect
44
and handle multiple versions of the same crate.
55

6+
```bash
7+
cargo deny check bans
8+
```
9+
10+
<img src="https://imgur.com/K3UeXcR.png"/>
11+
612
## Use Case - Denying specific crates
713

814
Sometimes, certain crates just don't fit in your project, so you have to remove

docs/src/checks/licenses/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ you find acceptable. cargo-deny does this by evaluating the license requirements
55
specified by each crate against the [configuration](cfg.md) you've specified to
66
determine if your project meets that crate's license requirements.
77

8+
```bash
9+
cargo deny check licenses
10+
```
11+
12+
<img src="https://imgur.com/XMmvx9L.png"/>
13+
814
### SPDX
915

1016
cargo-deny uses [SPDX license expressions][SPDX] as the source of truth for the

docs/src/checks/sources/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,19 @@
22

33
The sources check ensures crates only come from sources you trust.
44

5+
```bash
6+
cargo deny check sources
7+
```
8+
9+
<img src="https://imgur.com/xdHFDWS.png"/>
10+
511
## Use Case - Only allowing known/trusted sources
612

713
Cargo can retrieve crates from a variety of sources, namely registries,
814
git repositories, or local file paths. This is great in general and very
9-
flexible for development. But esp. re-routing dependencies to git repositories increases the amount of sources that one would have to trust and may be something a repository want explicitly opt-in to.
15+
flexible for development. But esp. re-routing dependencies to git repositories
16+
increases the amount of sources that one would have to trust and may be
17+
something a repository want explicitly opt-in to.
1018

1119
See [Why npm lockfiles can be a security blindspot for injecting malicious modules](https://snyk.io/blog/why-npm-lockfiles-can-be-a-security-blindspot-for-injecting-malicious-modules/)
1220
for the motivating reason for why this check was added.

examples/01_allow_license/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ the license requirements of every crate in your dependency graph.
55

66
## Requirement
77

8-
```toml
8+
```ini
99
license = "MIT OR Apache-2.0"
1010
```
1111

1212
## Config
1313

14-
```toml
14+
```ini
1515
[license]
1616
allow = [ "MIT" ]
1717
```

examples/02_deny_license/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ the license requirements of every crate in your dependency graph.
55

66
## Requirement
77

8-
```toml
8+
```ini
99
license = "MIT AND Apache-2.0"
1010
```
1111

1212
## Config
1313

14-
```toml
14+
```ini
1515
[licenses]
1616
allow = [ "MIT" ]
1717
deny = [ "Apache-2.0" ]

examples/03_deny_copyleft/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ the license requirements of every crate in your dependency graph.
55

66
## Requirement
77

8-
```toml
8+
```ini
99
license = "MIT AND Apache-2.0"
1010
```
1111

1212
## Config
1313

14-
```toml
14+
```ini
1515
[licenses]
1616
allow = [ "MIT" ]
1717
deny = [ "Apache-2.0" ]

examples/04_gnu_licenses/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ This example shows how to deal with the GNU style licenses such as GPL, AGPL, LG
44

55
## Requirement
66

7-
```toml
7+
```ini
88
license = "GPL-2.0-or-later AND LGPL-3.0-only"
99
```
1010

1111
## Config
1212

13-
```toml
13+
```ini
1414
[licenses]
1515
allow = [ "GPL-3.0" ]
1616
copyleft = "deny"

examples/06_advisories/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example shows cargo-deny's default behavior when checking security advisori
44

55
## Config
66

7-
```toml
7+
```ini
88
[dependencies]
99
# ammonia had a stack overflow < 2.1.0
1010
# https://github.com/RustSec/advisory-db/blob/01ac6725d549dbc7873250fe2a55e54d528fe945/crates/ammonia/RUSTSEC-2019-0001.toml

0 commit comments

Comments
 (0)