You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 30, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: apps/nextra/pages/en/build/smart-contracts/linter.mdx
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,23 @@ If you find any issues, please submit [bugs and feedback](https://github.com/apt
12
12
13
13
14
14
## Lint Checks
15
+
16
+
### `aborting_overflow_checks`
17
+
18
+
Checks for patterns that look like overflow checks done in a C style:
19
+
```move
20
+
// Overflow check
21
+
if (x > x + y) {
22
+
abort 1;
23
+
};
24
+
25
+
// Underflow check
26
+
if (x < x - y) {
27
+
abort 1;
28
+
};
29
+
```
30
+
This pattern in Move does not make sense, as it either aborts immediately or is always true/false.
31
+
15
32
### `almost_swapped`
16
33
Checks for expression patterns that look like a failed swap attempt and notifies the user. These patterns are likely erroneous code. This currently only detects simple access patterns such as assignments to a variable or a field of a struct. Examples include:
17
34
-`a = b; b = a;` which can be correctly swapped with `(a, b) = (b, a);`
0 commit comments