Skip to content

Commit 002e27d

Browse files
authored
Merge pull request #287 from onflow/claude/update-agents-guidelines-IPuNw
Add Cadence coding guidelines to AGENTS.md
2 parents 7869867 + fc6abef commit 002e27d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ flow test cadence/tests/interest_accrual_integration_test.cdc --name test_combin
5757
```bash
5858
grep "fun test" cadence/tests/interest_accrual_integration_test.cdc
5959
```
60+
61+
# Cadence Coding Guidelines
62+
63+
- Use string templating, not concatenation: `"Hello \(name)"` not `"Hello ".concat(name)`
64+
- Use `equalWithinVariance` from `test_helpers.cdc` for equality assertions where rounding errors are possible
65+
- Use red-green TDD for bug fixes and extensions to functionality. Tests must use assertions (eg. `Test.assert`) to verify expected behaviour, not logs.

0 commit comments

Comments
 (0)