Skip to content

Commit

Permalink
doc: add intro of --skip-lint and link to Safety Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
yanCode committed Nov 18, 2024
1 parent 1e38700 commit 1a94ded
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
13 changes: 13 additions & 0 deletions docs/src/pages/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ anchor build

Builds programs in the workspace targeting Solana's BPF runtime and emitting IDLs in the `target/idl` directory.


```shell
anchor build --skip-lint
```

Disables [Safety Checks](/docs/the-accounts-struct#safety-checks) during the build process.

```shell
anchor build --verifiable
```
Expand Down Expand Up @@ -283,6 +290,12 @@ anchor test
Run an integration test suit against the configured cluster, deploying new versions
of all workspace programs before running them.

```shell
anchor test --skip-lint
```

Similar to `anchor build`, `--skip-lint` option disables [Safety Checks](/docs/the-accounts-struct#safety-checks).

If the configured network is a localnet, then automatically starts the localnetwork and runs
the test.

Expand Down
12 changes: 12 additions & 0 deletions docs/src/pages/docs/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ Example:
resolution = true
```

#### skip-lint

This disables the safety checks globally. The default is `false`.

Example:

```
[features]
skip-lint = true
```
See [Safety Checks](/docs/the-accounts-struct#safety-checks) for more information.

## workspace

#### types
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/the-accounts-struct.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub struct Initialize<'info> {
The doc comment needs to be a [line or block doc comment](https://doc.rust-lang.org/reference/comments.html#doc-comments) (/// or /\*\*) to be interpreted as doc attribute by Rust. Double slash comments (//) are not interpreted as such.
{% /callout %}

#### Disabling safety checks
### Disabling safety checks

For purposes like quick prototyping, you can disable the safety checks by appending the `--skip-lint` option to Anchor CLI commands:

Expand Down

0 comments on commit 1a94ded

Please sign in to comment.