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
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@ jobs:

- name: Pack dry run
run: bun run pack:dry-run

rust-lints:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1

- name: Install Rust lint toolchain
run: |
rustup toolchain install nightly-2026-04-16 --profile minimal \
--component rustc-dev \
--component llvm-tools-preview
cargo install dylint-link --version 6.0.1 --locked

- name: Test Rust lints
run: cd rust-lints/stella_lints && cargo test
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This repo intentionally contains only portable tooling policy:
- `@stll/oxlint-config`: general upstream oxlint rules and the shared
`stella-lowercase` and `no-raw-colors` JS plugins.
- `rust/`: source-of-truth Rust formatting, lint, and Cargo profile templates.
- `rust-lints/`: Dylint libraries for stella-specific Rust rules.

Repo-specific stella rules stay in the consuming repo: custom oxlint plugins,
security rules, i18n rules, generated native artifacts, benchmark exceptions,
Expand Down Expand Up @@ -94,9 +95,18 @@ Use the Rust templates by copying them into a Rust repository:
```bash
cp rust/rustfmt.toml /path/to/repo/rustfmt.toml
cp rust/clippy.toml /path/to/repo/clippy.toml
cp rust/dylint.toml /path/to/repo/dylint.toml
```

Then copy either `rust/cargo-root.toml` or `rust/cargo-workspace.toml` into the
repository's root `Cargo.toml`. Cargo does not support extending these settings
from another package, so the templates are kept here as the canonical source and
synced into consumers.

Pin the `rev` in `dylint.toml` to the exact tooling commit being adopted. Then
run Clippy first and Dylint second:

```bash
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo dylint --workspace --all -- --all-targets --all-features -- -D warnings
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build": "bun --filter @stll/oxlint-config build",
"typecheck": "bun --filter @stll/oxlint-config typecheck",
"test": "bun test",
"test:rust-lints": "cd rust-lints/stella_lints && cargo test",
"lint": "bun run build && bun --bun oxlint -c oxlint.config.ts --report-unused-disable-directives-severity=error --deny-warnings --type-aware .",
"lint:fix": "bun --bun oxlint -c oxlint.config.ts --type-aware --fix .",
"format": "oxfmt . \"!.ai/**\" \"!.agents/**\" \"!.claude/**\" \"!AGENTS.md\" \"!CLAUDE.md\" \"!GEMINI.md\"",
Expand Down
34 changes: 34 additions & 0 deletions rust-lints/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# stella Rust lints

Custom Dylint libraries for stella Rust repositories.

These rules are the Rust equivalent of shared custom oxlint rules: they enforce
stella-specific policy that Clippy cannot know about.

## Libraries

- `stella_lints`: shared Rust house rules.

## Current Rules

- `stella_lowercase`: flags string literals containing `Stella`; use lowercase
`stella` in public docs, diagnostics, and logs.

## Consumer Setup

Install the Dylint runner:

```bash
cargo install cargo-dylint dylint-link
```

Copy `rust/dylint.toml` to the consuming repository root, pin the
`stella/tooling` `rev`, then run:

```bash
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo dylint --workspace --all

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Deny warnings in the consumer Dylint snippet

Fresh evidence: the alias and top-level README now forward -D warnings, but this remaining setup command still runs only cargo dylint --workspace --all. Because stella_lowercase is registered at Warn, consumers following this README get a successful run even when violations are printed; the upstream Dylint README describes --all as loading discovered libraries, with cargo/rustc flags passed after -- (source). Please keep this snippet aligned with the enforced command in rust/README.md.

Useful? React with 👍 / 👎.

```

Keep repo-specific exceptions narrow and local. If a rule is broadly wrong,
fix it here instead of suppressing it in every consuming repository.
6 changes: 6 additions & 0 deletions rust-lints/stella_lints/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[target.'cfg(all())']
rustflags = ["-C", "linker=dylint-link"]

# For Rust versions 1.74.0 and onward, the following alternative can be used
# (see https://github.com/rust-lang/cargo/pull/12535):
# linker = "dylint-link"
1 change: 1 addition & 0 deletions rust-lints/stella_lints/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading