项目初始化

This commit is contained in:
soul-walker 2024-08-08 15:58:56 +08:00
commit 2b38e29239
7 changed files with 127 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

50
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,50 @@
fail_fast: false
repos:
- repo: https://gitea.joylink.club/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
description: Format files with rustfmt.
entry: bash -c 'cargo fmt -- --check'
language: rust
files: \.rs$
args: []
- id: typos
name: typos
description: check typo
entry: bash -c 'typos'
language: rust
files: \.*$
pass_filenames: false
- id: cargo-check
name: cargo check
description: Check the package for errors.
entry: bash -c 'cargo check --all'
language: rust
files: \.rs$
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
description: Lint rust sources
entry: bash -c 'cargo clippy --all-targets --all-features --tests --benches -- -D warnings'
language: rust
files: \.rs$
pass_filenames: false
- id: cargo-test
name: cargo test
description: unit test for the project
entry: bash -c 'cargo nextest run --all-features'
language: rust
files: \.rs$
pass_filenames: false

7
Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "rtss_simulation"
version = "0.1.0"

8
Cargo.toml Normal file
View File

@ -0,0 +1,8 @@
[package]
name = "rtss_simulation"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

54
README.md Normal file
View File

@ -0,0 +1,54 @@
# rtss-simulation
轨道交通信号系统仿真模块
## 环境设置说明
### 安装 Rust
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
### 推荐安装的 VSCode 插件
- Dependi: Rust 包管理
- Even Better TOML: TOML 文件支持
- Better Comments: 优化注释显示
- Error Lens: 错误提示优化
- GitLens — Git supercharged: Git 增强
- Github Copilot: 代码提示
- indent-rainbow: 缩进显示优化
- Prettier - Code formatter: 代码格式化
- REST client: REST API 调试
- rust-analyzer: Rust 语言支持
- Rust Test lens: Rust 测试支持
- Rust Test Explorer: Rust 测试概览
- TODO Highlight: TODO 高亮
- vscode-icons: 图标优化
- YAML: YAML 文件支持
### 安装 pre-commit
pre-commit 是一个代码检查工具,可以在提交代码前进行代码检查。
```bash
pipx install pre-commit
```
安装成功后运行 `pre-commit install` 即可。
### 安装 typos
typos 是一个拼写检查工具。
```bash
cargo install typos-cli
```
### 安装 cargo nextest
cargo nextest 是一个 Rust 增强测试工具。
```bash
cargo install cargo-nextest --locked
```

4
_typos.toml Normal file
View File

@ -0,0 +1,4 @@
[default.extend-words]
[files]
extend-exclude = ["README.md"]

3
src/main.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}