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: 13 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
name = "rct"
version = "0.1.0"
edition = "2024"
authors = ["lsh <lhui.dev@gmail.com>"]
description = "Rust code template."
rust-version = "1.85"
publish = false
authors = ["{{ authors }}"]
description = "{{description}}"
readme = "README.md"
repository = "https://github.com/lhui-dev/rct"
repository = "{{repository}}"
license = "MIT"
keywords = ["template", "rust", "project"]
categories = ["development-tools"]

[dependencies]

[lints.rust]
unsafe_code = "forbid"

[lints.clippy]
dbg_macro = "deny"
todo = "deny"
unwrap_used = "warn"
5 changes: 4 additions & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ No boilerplate setup. No repeated configuration. Just focus on building.

* `cargo clippy` + `cargo fmt`
* `typos` spell checking
* Includes baseline lint rules and a declared minimum Rust version

### 🔐 Dependency Safety

Expand Down Expand Up @@ -190,10 +191,12 @@ cargo deny check

## ⚙️ Customization

Supports `cargo-generate.toml` for template variables like `description`.
Supports `cargo-generate.toml` for template variables such as `description`, `authors`, and `repository` in `Cargo.toml`.

After generating a project, update the repository URL in `cliff.toml` to match your own repository.

The template still keeps a fixed package name `rct` so the template repository itself remains buildable with `cargo check`. If you want the package name to be generated too, I can convert it into a pure template setup next.

---

## 🤝 Contributing
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

* 集成 `cargo clippy` + `cargo fmt`
* `typos` 拼写检查
* 默认包含基础 lint 约束与 Rust 版本声明

### 🔐 依赖安全

Expand Down Expand Up @@ -204,10 +205,12 @@ cargo deny check

## ⚙️ 模板自定义

支持通过 `cargo-generate.toml` 定义模板变量,实现初始化时动态替换,例如 `description`。
支持通过 `cargo-generate.toml` 定义模板变量,实现初始化时动态替换,例如 `Cargo.toml` 中的 `description`、`authors` 和 `repository`。

生成项目后,记得把 `cliff.toml` 里的仓库地址改成你自己的仓库地址。

当前模板仍保留固定包名 `rct`,这样模板仓库本身还能继续正常执行 `cargo check`;如果你希望生成时连包名也一起改,我可以继续把它改成“纯模板模式”。

---

## 🤝 贡献
Expand Down
5 changes: 5 additions & 0 deletions cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ ignore = [".idea", "target", "CHANGELOG.md"]
type = "string"
prompt = "What does your project do?"
default = "A Rust project."

[placeholders.repository]
type = "string"
prompt = "What is your repository URL?"
default = "https://github.com/your-username/your-repo"
Loading