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
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
- [ ] `cargo fmt --all -- --check` is clean
- [ ] If behaviour differs from the Go implementation, the README's
"Differences from the Go implementation" section says so and why
- [ ] A change to options, output or the protocol has already merged in the
Go client
- [ ] I have read [AGENTS.md](../blob/master/AGENTS.md) and approved
everything in this pull request myself
67 changes: 67 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# AGENTS.md

For coding agents and other automated tools, and for the people who run them.
The same rules apply to changes written by hand.

## What this project is

`librespeed-cli` here is the Rust port of the Go client
[librespeed/speedtest-cli](https://github.com/librespeed/speedtest-cli). It is
meant to behave like the Go client: the same options, exit codes, messages and
report formats.

- A change to the protocol, the options or the output goes to the Go client
first. It comes here after it has merged there. A pull request that is ahead
of the Go client waits or is closed.
- A difference from Go that is meant to stay is listed under "Differences from
the Go implementation" in `README.md`, with the reason.
- `tests/parity` runs both clients against the same servers and compares what
they print. The Go commit it uses is `GO_COMMIT` in `tests/parity/cases.rs`
and `LIBRESPEED_GO_COMMIT` in `.github/workflows/ci.yml`. Do not loosen its
normalizer or rewrite its expectations to make a change pass. If the two
clients differ, the change is wrong or the difference belongs in the README.

## Rules the code keeps

- Text from a server or a server list is untrusted. It goes through
`output::sanitize` before it reaches the terminal or a report, and CSV text
goes through `csv_text` in `src/report.rs`.
- Numbers in JSON are written the way Go writes them, through `go_float` in
`src/report.rs`.
- The build keeps working with `--no-default-features --features native-tls`,
on the Rust version `Cargo.toml` names, and on 32-bit targets without 64-bit
atomics.
- `.github/workflows/ci.yml` is also the gate of the release workflow. A job
added there can block a release.

## Before you open or update a pull request

Run what CI runs:

```sh
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test
cargo test --no-default-features --features native-tls
```

For a change to options, output or the protocol, also run the parity test.
`README.md` says how under "Testing".

## Pull requests and comments

- A person reads and approves every push and every comment before it goes out,
and can explain every line of the change.
- A pull request does one thing. Its description says what changes for a user,
such as a new CSV column, JSON key or message.
- Push when the change is ready, not after each finding. Do not ask an
automated reviewer for a new review after every push, and do not change code
only because one asked. A person decides first whether the finding is right.
- Comment to answer a maintainer or to explain a decision. Post no status
updates, no repeated summaries of test runs and no mentions of yourself. The
description and the commits are the record.
- Do not open the same change in several repositories at once. Start where it
has to land first and wait for it to merge.

Maintainers may close or lock a pull request or an issue that does not follow
this.
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing

Bug reports and pull requests are welcome.

- This client follows the Go client. A new feature or a change to the output
goes to [librespeed/speedtest-cli](https://github.com/librespeed/speedtest-cli)
first and comes here after it has merged there.
- Run the checks from the pull request template before you push.
- You may use an AI tool to write code or text. You are still the author: read
and approve everything before it is pushed or posted, and be ready to
explain it.
- Keep the discussion short. Comment when there is something to say, and post
no status updates.

[AGENTS.md](AGENTS.md) has the full rules, for tools and for the people who
run them.
Loading