Skip to content

Commit 440291d

Browse files
docs(standards): add Rust language ecosystem documentation
Add Rust as the 8th supported language on devrail.dev: - content/docs/standards/rust.md: full Rust standards page - content/docs/standards/_index.md: add Rust to matrix, target mapping, and per-language links - content/_index.md: update language list and container description - content/blog/2026-03-02-introducing-devrail.md: update container tools table and language count Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b1f5a13 commit 440291d

4 files changed

Lines changed: 155 additions & 25 deletions

File tree

content/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ the retrofit guide at: https://devrail.dev/docs/getting-started/retrofit/
8484
## Language Detection
8585
Languages are declared in `.devrail.yml`. The Makefile reads this file
8686
to determine which tools to run. Supported languages:
87-
python, bash, terraform, ansible, ruby, go, javascript
87+
python, bash, terraform, ansible, ruby, go, javascript, rust
8888
8989
See https://devrail.dev/docs/standards/ for per-language tool details.
9090
```
@@ -110,7 +110,7 @@ Run `make check` and get consistent results everywhere -- your laptop, CI, or an
110110
{{% /blocks/feature %}}
111111

112112
{{% blocks/feature icon="fa-cube" title="One Container" %}}
113-
The `dev-toolchain` container includes linters, formatters, security scanners, and test runners for Python, Bash, Terraform, Ansible, Ruby, Go, and JavaScript/TypeScript. Pin a version and forget about tool management.
113+
The `dev-toolchain` container includes linters, formatters, security scanners, and test runners for Python, Bash, Terraform, Ansible, Ruby, Go, JavaScript/TypeScript, and Rust. Pin a version and forget about tool management.
114114

115115
[Learn About the Container](/docs/container/)
116116
{{% /blocks/feature %}}

content/blog/2026-03-02-introducing-devrail.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ Already have a project? The [retrofit guide](/docs/getting-started/retrofit/) wa
5151

5252
## What's in the Container
5353

54-
The `dev-toolchain` container includes tools for seven language ecosystems. Each language has opinionated defaults documented in the [standards reference](/docs/standards/).
54+
The `dev-toolchain` container includes tools for eight language ecosystems. Each language has opinionated defaults documented in the [standards reference](/docs/standards/).
5555

56-
| Concern | Python | Bash | Terraform | Ansible | Ruby | Go | JS/TS |
57-
|---|---|---|---|---|---|---|---|
58-
| Linter | ruff | shellcheck | tflint | ansible-lint | rubocop | golangci-lint | eslint |
59-
| Formatter | ruff | shfmt | terraform fmt | -- | rubocop | gofumpt | prettier |
60-
| Security | bandit | -- | tfsec | -- | brakeman | govulncheck | npm audit |
61-
| Tests | pytest | bats | terratest | molecule | rspec | go test | vitest |
56+
| Concern | Python | Bash | Terraform | Ansible | Ruby | Go | JS/TS | Rust |
57+
|---|---|---|---|---|---|---|---|---|
58+
| Linter | ruff | shellcheck | tflint | ansible-lint | rubocop | golangci-lint | eslint | clippy |
59+
| Formatter | ruff | shfmt | terraform fmt | -- | rubocop | gofumpt | prettier | rustfmt |
60+
| Security | bandit | -- | tfsec | -- | brakeman | govulncheck | npm audit | cargo-audit |
61+
| Tests | pytest | bats | terratest | molecule | rspec | go test | vitest | cargo test |
6262

6363
Universal tools -- trivy, gitleaks, and git-cliff -- run for every project regardless of language.
6464

@@ -76,7 +76,7 @@ See the [agent setup guide](/docs/getting-started/agents/) for detailed configur
7676

7777
## Current Status
7878

79-
DevRail is in **beta**. The core contract -- Makefile, container, `.devrail.yml` -- is stable and used in production projects. Language support for all seven ecosystems ships in the `v1` container image. Standards, tool versions, and defaults may still change based on real-world usage.
79+
DevRail is in **beta**. The core contract -- Makefile, container, `.devrail.yml` -- is stable and used in production projects. Language support for all eight ecosystems ships in the `v1` container image. Standards, tool versions, and defaults may still change based on real-world usage.
8080

8181
What works today: new projects from templates, retrofitting existing repos, CI integration, agent instruction files, and `make fix` auto-remediation. What's still evolving: additional language ecosystems and edge cases we haven't hit yet.
8282

content/docs/standards/_index.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Standards"
33
linkTitle: "Standards"
44
weight: 20
5-
description: "Per-language tooling standards for Python, Bash, Terraform, Ansible, Ruby, Go, JavaScript/TypeScript, and universal security tools."
5+
description: "Per-language tooling standards for Python, Bash, Terraform, Ansible, Ruby, Go, JavaScript/TypeScript, Rust, and universal security tools."
66
---
77

88
DevRail defines opinionated tooling standards for each supported language ecosystem. Every tool is pre-installed in the dev-toolchain container and invoked through consistent Makefile targets.
@@ -11,15 +11,15 @@ DevRail defines opinionated tooling standards for each supported language ecosys
1111

1212
The following table shows the default tool for each concern per language. These tools are pre-installed in the `dev-toolchain` container.
1313

14-
| Concern | Python | Bash | Terraform | Ansible | Ruby | Go | JavaScript |
15-
|---|---|---|---|---|---|---|---|
16-
| Linter | ruff | shellcheck | tflint | ansible-lint | rubocop, reek | golangci-lint | eslint |
17-
| Formatter | ruff format | shfmt | terraform fmt | -- | rubocop | gofumpt | prettier |
18-
| Security | bandit, semgrep | -- | tfsec, checkov | -- | brakeman, bundler-audit | govulncheck | npm audit |
19-
| Tests | pytest | bats | terratest | molecule | rspec | go test | vitest |
20-
| Type Check | mypy | -- | -- | -- | sorbet | -- | tsc |
21-
| Docs | -- | -- | terraform-docs | -- | -- | -- | -- |
22-
| Universal | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff |
14+
| Concern | Python | Bash | Terraform | Ansible | Ruby | Go | JavaScript | Rust |
15+
|---|---|---|---|---|---|---|---|---|
16+
| Linter | ruff | shellcheck | tflint | ansible-lint | rubocop, reek | golangci-lint | eslint | clippy |
17+
| Formatter | ruff format | shfmt | terraform fmt | -- | rubocop | gofumpt | prettier | rustfmt |
18+
| Security | bandit, semgrep | -- | tfsec, checkov | -- | brakeman, bundler-audit | govulncheck | npm audit | cargo-audit, cargo-deny |
19+
| Tests | pytest | bats | terratest | molecule | rspec | go test | vitest | cargo test |
20+
| Type Check | mypy | -- | -- | -- | sorbet | -- | tsc | -- |
21+
| Docs | -- | -- | terraform-docs | -- | -- | -- | -- | -- |
22+
| Universal | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff | trivy, gitleaks, git-cliff |
2323

2424
A `--` entry means the concern does not apply to that language. Universal tools run for all projects regardless of declared languages.
2525

@@ -29,11 +29,11 @@ Each Makefile target runs the relevant tools for all languages declared in `.dev
2929

3030
| Target | What It Runs |
3131
|---|---|
32-
| `make lint` | ruff check, shellcheck, tflint, ansible-lint, mypy, rubocop, reek, golangci-lint, eslint, tsc |
33-
| `make format` | ruff format --check, shfmt -d, terraform fmt -check, rubocop --check, gofumpt -d, prettier --check |
34-
| `make fix` | ruff format, shfmt -w, terraform fmt, rubocop -a, gofumpt -w, prettier --write |
35-
| `make test` | pytest, bats, terratest, molecule, rspec, go test, vitest |
36-
| `make security` | bandit, semgrep, tfsec, checkov, brakeman, bundler-audit, govulncheck, npm audit |
32+
| `make lint` | ruff check, shellcheck, tflint, ansible-lint, mypy, rubocop, reek, golangci-lint, eslint, tsc, clippy |
33+
| `make format` | ruff format --check, shfmt -d, terraform fmt -check, rubocop --check, gofumpt -d, prettier --check, cargo fmt --check |
34+
| `make fix` | ruff format, shfmt -w, terraform fmt, rubocop -a, gofumpt -w, prettier --write, cargo fmt |
35+
| `make test` | pytest, bats, terratest, molecule, rspec, go test, vitest, cargo test |
36+
| `make security` | bandit, semgrep, tfsec, checkov, brakeman, bundler-audit, govulncheck, npm audit, cargo-audit, cargo-deny |
3737
| `make scan` | trivy, gitleaks (universal -- all projects) |
3838
| `make docs` | terraform-docs |
3939
| `make changelog` | git-cliff (generate CHANGELOG.md from conventional commits) |
@@ -49,6 +49,7 @@ Each Makefile target runs the relevant tools for all languages declared in `.dev
4949
- [Ruby Standards](/docs/standards/ruby/) -- rubocop, brakeman, bundler-audit, rspec, reek, sorbet
5050
- [Go Standards](/docs/standards/go/) -- golangci-lint, gofumpt, govulncheck, go test
5151
- [JavaScript Standards](/docs/standards/javascript/) -- eslint, prettier, npm audit, vitest, tsc
52+
- [Rust Standards](/docs/standards/rust/) -- clippy, rustfmt, cargo-audit, cargo-deny, cargo test
5253
- [Universal Security](/docs/standards/universal/) -- trivy, gitleaks, git-cliff
5354

5455
## Consistent Page Structure

content/docs/standards/rust.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: "Rust"
3+
linkTitle: "Rust"
4+
weight: 35
5+
description: "Rust tooling standards: clippy, rustfmt, cargo-audit, cargo-deny, and cargo test."
6+
---
7+
8+
Rust projects use clippy for linting, rustfmt for formatting, cargo-audit and cargo-deny for security scanning, and cargo test for testing.
9+
10+
## Tools
11+
12+
| Category | Tool | Purpose |
13+
|---|---|---|
14+
| Linter | clippy | Official Rust linter (rustup component) |
15+
| Formatter | rustfmt | Official Rust formatter (rustup component) |
16+
| Security (vulns) | cargo-audit | Scans Cargo.lock for known vulnerabilities |
17+
| Security (policy) | cargo-deny | Enforces dependency policies (licenses, bans, sources) |
18+
| Tests | cargo test | Built-in Rust test runner |
19+
20+
All tools are pre-installed in the dev-toolchain container. Do not install them on the host.
21+
22+
## Configuration
23+
24+
### clippy
25+
26+
Config file: `clippy.toml` at repository root.
27+
28+
```toml
29+
# clippy.toml -- DevRail Rust clippy configuration
30+
# See: https://doc.rust-lang.org/clippy/lint_configuration.html
31+
too-many-arguments-threshold = 7
32+
```
33+
34+
Clippy is invoked with `-D warnings` to treat all warnings as errors. Additional lint groups can be enabled via `#![warn(clippy::pedantic)]` in `lib.rs` or `main.rs`.
35+
36+
### rustfmt
37+
38+
Config file: `rustfmt.toml` at repository root.
39+
40+
```toml
41+
# rustfmt.toml -- DevRail Rust formatter configuration
42+
edition = "2021"
43+
max_width = 100
44+
use_field_init_shorthand = true
45+
use_try_shorthand = true
46+
```
47+
48+
### cargo-audit
49+
50+
No config file required. Scans `Cargo.lock` for known vulnerabilities in crate dependencies using the RustSec Advisory Database.
51+
52+
### cargo-deny
53+
54+
Config file: `deny.toml` at repository root.
55+
56+
```toml
57+
# deny.toml -- DevRail cargo-deny configuration
58+
# See: https://embarkstudios.github.io/cargo-deny/
59+
60+
[advisories]
61+
vulnerability = "deny"
62+
unmaintained = "warn"
63+
yanked = "warn"
64+
65+
[licenses]
66+
unlicensed = "deny"
67+
allow = [
68+
"MIT",
69+
"Apache-2.0",
70+
"BSD-2-Clause",
71+
"BSD-3-Clause",
72+
"ISC",
73+
"Unicode-3.0",
74+
"Unicode-DFS-2016",
75+
]
76+
77+
[bans]
78+
multiple-versions = "warn"
79+
80+
[sources]
81+
unknown-registry = "deny"
82+
unknown-git = "warn"
83+
```
84+
85+
## Makefile Targets
86+
87+
| Target | Command | Description |
88+
|---|---|---|
89+
| `make lint` | `cargo clippy --all-targets --all-features -- -D warnings` | Lint all Rust files |
90+
| `make format` | `cargo fmt --all -- --check` | Check formatting |
91+
| `make fix` | `cargo fmt --all` | Apply formatting fixes |
92+
| `make security` | `cargo audit` | Dependency vulnerability scanning (if `Cargo.lock` exists) |
93+
| `make security` | `cargo deny check` | Dependency policy checking (if `deny.toml` exists) |
94+
| `make test` | `cargo test --all-targets` | Run test suite (if `*.rs` files and `Cargo.toml` exist) |
95+
96+
## Pre-Commit Hooks
97+
98+
### Local Hooks (run on every commit, under 30 seconds)
99+
100+
Formatting and linting with cargo via pre-commit-cargo:
101+
102+
```yaml
103+
# .pre-commit-config.yaml -- Rust hooks
104+
repos:
105+
- repo: https://github.com/AndrejOrsula/pre-commit-cargo
106+
rev: v0.4.0
107+
hooks:
108+
- id: cargo-fmt
109+
args: ["--all", "--", "--check"]
110+
- id: cargo-clippy
111+
args: ["--all-targets", "--all-features", "--workspace", "--", "-D", "warnings"]
112+
```
113+
114+
### CI-Only (too slow for local hooks)
115+
116+
- `cargo audit` -- dependency vulnerability scanning
117+
- `cargo deny check` -- dependency policy enforcement
118+
- `cargo test --all-targets` -- full test suite
119+
120+
## Notes
121+
122+
- **Clippy is the single linting tool.** It is the official Rust linter, bundled as a rustup component. It subsumes many standalone lint tools.
123+
- **rustfmt is the single formatting tool.** It is the official Rust formatter, also bundled as a rustup component. There is no "strict superset" -- rustfmt is the standard.
124+
- **The entire Rust toolchain is included in the container.** Clippy and rustfmt are tightly coupled to the compiler version. The full toolchain (rustup + cargo + rustc + stdlib) is COPY'd from the builder stage.
125+
- **`Cargo.lock` presence gates vulnerability scanning.** If no `Cargo.lock` file exists, `cargo audit` is skipped because there are no pinned dependencies to scan.
126+
- **`deny.toml` presence gates policy checking.** If no `deny.toml` file exists, `cargo deny` is skipped.
127+
- **`cargo test --all-targets` runs all test types.** This includes unit tests, integration tests, doc tests, and examples. It gates on the presence of `*.rs` files and `Cargo.toml`.
128+
- **All tools are pre-installed in the dev-toolchain container.** Do not install them on the host.
129+
- For cross-cutting coding practices and git workflow standards that apply to all languages, see [Coding Practices](/docs/standards/practices/).

0 commit comments

Comments
 (0)