Ajout d'une CI et de paramètres pour clippy et rustfmt
Some checks failed
Rust Checks / checks (push) Failing after 6s

This commit is contained in:
Tipragot 2024-02-04 16:47:07 +01:00
parent 2bb65bf466
commit 108f97ce47
3 changed files with 46 additions and 0 deletions

19
.gitea/workflows/rust.yml Normal file
View file

@ -0,0 +1,19 @@
on: [push, pull_request]
name: Rust Checks
jobs:
checks:
runs-on: main
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use cache
run: mkdir -p /cache/${{ gitea.repository }} && ln -s /cache/${{ gitea.repository }} target
- name: Cargo fmt
run: cargo fmt --check
- name: Cargo build
run: cargo build
- name: Cargo test
run: cargo test
- name: Cargo clippy
run: cargo clippy -- -D warnings

View file

@ -9,6 +9,15 @@ keywords = ["bevy", "network", "game"]
categories = ["network-programming", "game-development"]
repository = "https://git.tipragot.fr/tipragot/bevnet"
[lints.rust]
missing_docs = "warn"
[lints.clippy]
missing_docs_in_private_items = "warn"
unwrap_in_result = "warn"
unwrap_used = "warn"
nursery = "warn"
[dependencies]
serde = { version = "1.0.160", features = ["derive"] }
bincode = "1.3.3"

18
rustfmt.toml Normal file
View file

@ -0,0 +1,18 @@
use_try_shorthand = true
use_field_init_shorthand = true
version = "Two"
error_on_line_overflow = true
error_on_unformatted = true
format_code_in_doc_comments = true
format_macro_bodies = true
format_macro_matchers = true
format_strings = true
imports_granularity = "Module"
group_imports = "StdExternalCrate"
normalize_doc_attributes = true
normalize_comments = true
wrap_comments = true