Contributing

Build linecop, run its gates, and send changes.

linecop v0.9.1 Manual

Manual contents

The repository’s CONTRIBUTING.md is the full guide. This page is the shape of the work.

Worktrees

Work in a sibling worktree. just fork creates one, and just land merges it back:

just fork <slug>           # a sibling worktree on a new branch
just fork <slug> --base=@ # the same, from the current commit
just land # in the worktree: gate, wip check, fast-forward, remove

A worktree only receives commits, never an uncommitted working tree, so commit before you land. The worktree hooks run the gate and the task check before the fast-forward.

The gate

just check runs formatting, clippy with warnings denied, the tests, the docs build and validation, the prose gate, and linecop on the repository itself. A change is ready when that command passes.

mt check --commits main..HEAD refuses a branch whose task is still marked wip. Close the task in the same branch.

Code style

The short version:

  • The project denies every clippy lint.
  • No unwrap, expect, todo, unimplemented, or unsafe.
  • No wildcard imports and no single-character names.
  • Functions stay at 70 lines, with at most five arguments and a cognitive complexity of 20.
  • Rust files cap at 500 lines. Markdown files cap at 200 lines.
  • Coverage runs with tarpaulin and holds at 70%.

main.rs stays a thin entry point. Logic lives in the library, where the tests reach it.

Releases

Bump the version in Cargo.toml and Cargo.lock, add a dated section to CHANGELOG.md, and commit that on main without pushing. Then:

just release X.Y.Z --dry-run   # every check, then what it would push
just release X.Y.Z # push main, wait for CI, tag, push the tag

The recipe pushes main, waits for the workflow on that exact commit, and tags only when the run passes. Never push main or a tag by hand. When a publish run fails, finish the release on the same tag with gh run rerun <run> --failed. A pushed tag does not move.

The changelog page has the current release. The usage page and configuration page are the behavior the tests protect.