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
45 changes: 43 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,52 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Check whitespace
run: git diff --check "$(git hash-object -t tree /dev/null)" HEAD
- name: Verify foundation files
- name: Install latest stable Rust toolchain
run: rustup toolchain install stable --profile minimal --component clippy,rustfmt,llvm-tools-preview
- name: Check formatting
run: cargo +stable fmt --check
- name: Run tests
run: cargo +stable test --locked
- name: Run Clippy
run: cargo +stable clippy --all-targets --locked -- -D warnings
- name: Build documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo +stable doc --no-deps --locked
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: cargo-llvm-cov@0.9.0
fallback: none
- name: Enforce test coverage
run: cargo +stable llvm-cov --all-features --locked --fail-under-lines 90 --fail-under-functions 95 --fail-under-regions 90
- name: Build release binary
run: cargo +stable build --release --locked
- name: Smoke test command metadata
run: |
./target/release/stack --help
./target/release/stack --version
- name: Verify repository files
run: |
test -s README.md
test -s AGENTS.md
test -s LICENSING.md
test -s Cargo.toml
test -s Cargo.lock
test -s src/main.rs

msrv:
name: Minimum supported Rust
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Install Rust 1.85
run: rustup toolchain install 1.85.0 --profile minimal --component clippy
- name: Run tests
run: cargo +1.85.0 test --locked
- name: Run Clippy
run: cargo +1.85.0 clippy --all-targets --locked -- -D warnings
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
138 changes: 138 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "stack-cli"
version = "0.1.0"
edition = "2024"
rust-version = "1.85"
publish = false
description = "Native command-line interface for Stack diagrams"
repository = "https://github.com/stack-sh/cli"

[[bin]]
name = "stack"
path = "src/main.rs"

[dependencies]
stack-engine = { git = "https://github.com/stack-sh/engine.git", rev = "07b71c783a3c1f9037d865b19672a9522eb0b24d" }

[lints.clippy]
expect_used = "deny"
panic = "deny"
todo = "deny"
unimplemented = "deny"
unreachable = "deny"
unwrap_used = "deny"
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@

`stack-sh/cli` is the private source repository for the native Rust `stack` command.

This repository currently contains only its repository foundation. It does not yet provide a distributable binary or a stable command-line interface.
The repository now contains the first native command: `stack check`. The CLI is not yet distributed as a supported external binary and its interface remains pre-release.

## Planned commands
## Commands

```text
stack render arch.stack -o arch.svg
stack check arch.stack
```

`stack check` reads the file as bytes and runs the full compiler, theme, layout, and routing validation pipeline without changing the source. Diagnostics are written to standard error in source order. Standard output remains empty.

| Result | Exit status |
| --- | ---: |
| No error diagnostics, including warning-only input | `0` |
| One or more Stack error diagnostics | `1` |
| Invalid arguments, host I/O failure, or engine operational failure | `2` |

The remaining planned commands are:

```text
stack render arch.stack -o arch.svg
stack fmt arch.stack
stack fmt --check arch.stack
```
Expand All @@ -19,7 +32,15 @@ Future authenticated theme delivery may add a client for short-lived, scope-limi

## Development

Repository checks currently validate the foundation files on every push and pull request. Rust formatting, linting, tests, and release builds will be added with the first CLI implementation.
The CLI requires Rust 1.85 or newer.

```sh
cargo run -- check arch.stack
cargo test --locked
cargo clippy --all-targets --locked -- -D warnings
```

CI validates formatting, unit and process-level integration tests, at least 90% line/region coverage and 95% function coverage, Clippy, documentation, a release build, `--help`, and `--version` on stable Rust. Tests and Clippy also run on Rust 1.85.

## Licensing

Expand Down
Loading