Skip to content

Commit

Permalink
Add Cadence Linter to CLI docs (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink authored Mar 18, 2024
1 parent 632ddf9 commit ffdfdb5
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/accounts/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Accounts",
"position": 4
"position": 3
}
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/boilerplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Cadence Boilerplate Generation
sidebar_label: Cadence Boilerplate
description: Cadence Boilerplate Generation via the CLI
sidebar_position: 13
sidebar_position: 16
---

## Introduction
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/data-collection.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Data Collection
description: Data collected from Flow CLI usage
sidebar_position: 14
sidebar_position: 17
---

Flow CLI tracks flow command usage count using Mixpanel.
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/flix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Flow Interaction Templates (FLIX)
sidebar_label: Flow Interaction Templates (FLIX)
description: Flow Interaction Templates (FLIX) via the CLI
sidebar_position: 12
sidebar_position: 15
---

FLIX helps developers reuse existing Cadence transactions and scripts to easily integrate with existing Cadence smart contracts. Get more information about [Flow Interaction Templates](../../build/advanced-concepts/flix.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/flow.json/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Flow.json",
"position": 9
"position": 8
}
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/flow_cli_cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Flow CLI Cheat sheet
sidebar_label: Flow CLI Cheatsheet
description: Flow CLI All Help Aggregation
sidebar_position: 15
sidebar_position: 18
---

```
Expand Down
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/install.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Install Instructions
description: How to install the Flow command-line interface (CLI)
sidebar_position: 2
sidebar_position: 1
---

The Flow CLI can be installed on macOS, Windows (7 or greater) and most Linux systems.
Expand Down
33 changes: 33 additions & 0 deletions docs/tools/flow-cli/lint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Cadence Linter
description: A static-analysis tool for finding potential issues in Cadence code
sidebar_position: 14
---

The Cadence Linter is a static-analysis tool for finding potential issues in Cadence code. It is available in the Flow CLI & is designed to help developers write better code by identifying common mistakes and potential issues before they become problems.

The linter will also check your code for any syntax or semantic errors, and provide suggestions for how to fix them.

```shell
flow cadence lint [files]
```

## Example Usage

```shell
flow cadence lint **/*.cdc
```

## Example Output

```shell
test.cdc:27:6: semantic-error: cannot find variable in this scope: `abc`

test.cdc:35:6: removal-hint: unnecessary force operator

2 problems (1 error, 1 warning)
```

:::info
The Cadence Linter is also available in the [Cadence VSCode extension](../vscode-extension/index.mdx), which provides real-time feedback as you write your code.
:::
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/migrate/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Migrate Projects to 1.0",
"position": 11
"position": 12
}
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/scripts/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Scripts",
"position": 7
"position": 6
}
2 changes: 1 addition & 1 deletion docs/tools/flow-cli/tests/_category_.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"label": "Tests",
"position": 11,
"position": 13
}

0 comments on commit ffdfdb5

Please sign in to comment.