From 22ddf8d09bad465dc5a6cd2a9a3d129e099acd3b Mon Sep 17 00:00:00 2001 From: Corentin Date: Tue, 9 Jan 2024 20:12:38 +0000 Subject: [PATCH] Initial commit --- .gitea/workflows/rust.yml | 19 +++++++++++++++++++ .gitignore | 1 + Cargo.lock | 7 +++++++ Cargo.toml | 16 ++++++++++++++++ rustfmt.toml | 18 ++++++++++++++++++ src/main.rs | 5 +++++ 6 files changed, 66 insertions(+) create mode 100644 .gitea/workflows/rust.yml create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 rustfmt.toml create mode 100644 src/main.rs diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml new file mode 100644 index 0000000..64ac40a --- /dev/null +++ b/.gitea/workflows/rust.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..af1dfb8 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "border-wars" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..6424d79 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "border-wars" +version = "0.1.0" +edition = "2021" +description = "An online turn based game." +repository = "https://git.tipragot.fr/corentin/border-wars.git" +authors = ["corentin"] + +[lints.rust] +missing_docs = "warn" + +[lints.clippy] +missing_docs_in_private_items = "warn" +unwrap_in_result = "warn" +unwrap_used = "warn" +nursery = "warn" diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..7bbd24c --- /dev/null +++ b/rustfmt.toml @@ -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 diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..fabf27d --- /dev/null +++ b/src/main.rs @@ -0,0 +1,5 @@ +//! A simple program that prints "Hello, world!" to the terminal. + +fn main() { + println!("Hello, world!"); +}