Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Rust
====

After changing Rust code (`*.rs`) first format the code using `cargo fmt`.

Then check the code for linting errors using:

```
cargo clippy --all-features --workspace --all-targets -- \
-D warnings \
-D clippy::all \
-D clippy::mem_forget \
-C debug-assertions=off \
-A clippy::uninlined_format_args
```

Fix any linting errors before continuing with building and testing.


Building
--------

Rust code is built using both `cargo build` and Bazel.

After changing a package under `rs/$PACKAGE` run `bazel build //rs/$PACKAGE`.


Changing crate dependencies
---------------------------

If crate dependencies need to be changed or added:

1. First modify the `Cargo.toml` local to the package.
2. If a crate is used by multiple packages add it to the workspace `Cargo.toml` in the root of the repo and reference it in the `Cargo.toml` local to the package using `{ workspace = true }`.
3. Add the crate to `bazel/rust.MODULE.bazel`.
4. Run a `cargo check` such that the `Cargo.lock` files get updated.
5. Run `bin/bazel-pin.sh --force` to sync `Cargo.lock` with `Cargo.Bazel.json.lock`.


Testing
=======

After code can be built it needs to be tested.

After changing a package under `rs/$PACKAGE` run `bazel test //rs/$PACKAGE`.

Tests under `rs/tests` which are defined using the `system_test` bazel macro are end-to-end tests which are called system-tests. These tests are comprehensive but also slow and harder to debug. So run them last or wait for GitHub Actions to run them on your Pull Request.
23 changes: 23 additions & 0 deletions .claude/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Claude Code
===========

You can you use Claude Code either from the:

* [Claude Code VS Code Extension](https://code.claude.com/docs/en/vs-code).

* CLI using the [`claude`](https://code.claude.com/docs/en/cli-reference) command which will be installed in the dev container later.

Login
-----

Ask #help-it to generate an Anthropic API key for you. Then:

* Select `2. Anthropic Console account · API usage billing`.

* Open the OAuth link in your browser.

* Choose the `DFINITY` organization.

* Authorize Claude Code to connect to your Anthropic organization DFINITY

* Press Enter to continue
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ go.sum @dfinity/idx
# [DevEnv]
.vscode/ @dfinity/idx

.claude/ @dfinity/idx

# [Publishing-Artifacts]
/publish/ @dfinity/idx

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,6 @@ test_tmpdir/**

# Bare metal deployment secrets files
zh2-dll01.csv

# Claude Code settings
.claude/settings.local.json
Loading