roc-lang / roc-lang/basic-cli

Run Rust formatting, tests, and Clippy in CI

Open
#443 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ci
Dominant language
Rust
Stars
121
Forks
45
Avg merge
18h 43m
Merged PRs (30d)
10

Description

Context

The CI jobs named “Format, check, and test examples” run ./scripts/test.py --operation validate:

  • .github/workflows/ci.yml:27-44
  • .github/workflows/ci.yml:46-62

That validation runs Roc tests/format/check operations, but it does not run Rust formatting, Rust tests, or Clippy. At commit 295000a during the release-candidate audit:

  • cargo check --locked --all-targets passed;
  • cargo fmt --all -- --check failed on formatting in src/lib.rs;
  • cargo test --locked --all-targets passed but ran zero Rust tests;
  • cargo clippy --locked --all-targets -- -D warnings failed on generated acronym names and a raw-pointer ABI lint.

The generated src/roc_platform_abi.rs needs targeted lint allowances rather than disabling useful linting for handwritten host code.

Suggested direction

Add a dedicated Rust validation job or extend the current validation job to run:

  • cargo fmt --all -- --check
  • cargo test --locked --all-targets
  • cargo clippy --locked --all-targets -- -D warnings

Configure narrow allowances for generated glue. Add unit tests for pure host helpers and error mappings so cargo test provides meaningful coverage in addition to end-to-end Roc examples.

Acceptance criteria

  • Rust formatting is required by CI and the current formatting difference is fixed.
  • Handwritten Rust passes Clippy with warnings denied.
  • Generated glue has documented, narrowly scoped lint allowances.
  • Rust tests cover representative HTTP method/error mapping, TCP read helpers, SQLite lifecycle helpers, and filesystem classification.
  • Contributor verification instructions list the same commands CI runs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the two validation jobs in .github/workflows/ci.yml:27-44 and 46-62, then inspect ./scripts/test.py --operation validate and src/lib.rs. Run the listed cargo fmt, cargo test, and cargo clippy commands to reproduce current failures; done means CI enforces them, generated src/roc_platform_abi.rs has narrow documented allowances, and the requested host-helper tests and contributor instructions are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, rust
Domain
ci-cd, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.