Skip to content

Commit 144974b

Browse files
committed
feat(otty): adopt a widgets-first workspace architecture
1 parent ca32320 commit 144974b

203 files changed

Lines changed: 18702 additions & 2597 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717
- uses: dtolnay/rust-toolchain@stable
18-
- run: cargo fmt --all -- --check
18+
- run: cargo +nightly fmt --all -- --check
1919
- run: cargo lint
20+
- run: cargo test -p otty --test widget_conventions_ast --locked --all-features

.github/workflows/tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ jobs:
2020
- uses: Swatinem/rust-cache@v2
2121
with:
2222
save-if: ${{ github.ref == 'refs/heads/main' }}
23+
- run: cargo test -p otty --test widget_conventions_ast --locked --all-features --verbose
2324
- run: cargo test --locked --all-features --verbose

AGENTS.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
# AGENTS Instructions
22

3-
General context lives in `README.md` at the repository root.
3+
General context lives in [README.md](./README.md) at the repository root.
44

55
## Development workflow
66

77
- Crate names stay prefixed with `otty-`.
88
- Prefer `format!("{value}")`-style interpolation instead of passing variables as separate arguments when formatting strings.
9-
- When touching Rust code, run `cargo fmt` followed by `cargo clippy --workspace --all-targets`. Fix warnings wherever practical.
10-
- Run `cargo test -p <crate>` (or `cargo test --workspace`) before submitting changes that affect logic-heavy crates like `otty-escape` or `otty-pty`.
119
- Add concise documentation comments to new public items to communicate intent.
1210
- Prefer borrowing over cloning; pass `&T`/`&str` where possible and keep ownership at boundaries.
1311
- Avoid unnecessary heap allocations; use slices and references for read-only data.
1412
- Use `Result`/`Option` for error handling; no `unwrap()` in production code (prefer `expect()` with context during initialization).
1513
- Use explicit error types (e.g., with `thiserror`) and propagate with `?`.
1614
- Keep APIs minimal and trait-based; use associated types for event/action contracts.
17-
- Prefer `format!("{value}")` style interpolation for strings.
15+
- Do not expose struct fields as `pub`; use idiomatic Rust accessors for reads (`field()` or `is_*` for booleans), and prefer domain-specific mutators for writes (use `set_*` only when a generic setter is the clearest option, or keep mutation local to the module). Exception: plain input/context structs with no invariants to protect (e.g. feature `Ctx` types passed into `reduce`) MAY use `pub(crate)` fields directly — accessors would be unnecessary boilerplate for parameter bags.
16+
- For `match` on `enum`, prefer a wildcard arm (`_ => ...`) by default for fallback logic.
1817
- Document public items with concise doc comments and examples.
19-
- Run `cargo fmt`, `cargo clippy --workspace --all-targets`, and relevant `cargo test` targets after changes.
18+
- Run `cargo +nightly fmt`, `cargo clippy --workspace --all-targets --all-features -- -D warnings` and fix all errors and warnings.
19+
- Run `cargo deny check` and fix all output errors.
20+
- Run `cargo test --workspace --all-features` all tests MUST be passed
21+
- Run `cargo llvm-cov --workspace --all-features --fail-under-lines 80` for checking the test coverage level and ensure that it's not decreased for changed code (baseline >= 80%)
2022

2123
## Terminal emulation
2224

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@AGENTS.md

0 commit comments

Comments
 (0)