From a3043a0aaa4332b617e489a5c5a94069e6a0f992 Mon Sep 17 00:00:00 2001 From: silvana Date: Tue, 11 Jun 2024 07:24:37 +0200 Subject: [PATCH] first commit --- .gitignore | 1 + .woodpecker.yml | 25 +++++++++++++++++++++++++ Cargo.lock | 7 +++++++ Cargo.toml | 27 +++++++++++++++++++++++++++ rustfmt.toml | 1 + src/main.rs | 3 +++ 6 files changed, 64 insertions(+) create mode 100644 .gitignore create mode 100644 .woodpecker.yml create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 rustfmt.toml create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/target diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..0e19063 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,25 @@ +matrix: + RUST: [stable, beta, nightly] + +steps: + fmt: + image: rust:alpine + environment: [CARGO_TERM_COLOR=always] + commands: + - rustup default $RUST + - rustup component add rustfmt + - cargo fmt -- --check + clippy: + image: rust:alpine + environment: [CARGO_TERM_COLOR=always] + commands: + - rustup default $RUST + - rustup component add clippy + - cargo clippy -- -D warnings + test: + image: rust:alpine + environment: [CARGO_TERM_COLOR=always] + commands: + - rustup default $RUST + - cargo check + - cargo test diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..92ee501 --- /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 = "template" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..d3e8816 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "template" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +[lints.rust] +unsafe_code = "forbid" + +[lints.clippy] +enum_glob_use = "deny" +nursery = { level = "deny", priority = -1 } +pedantic = { level = "deny", priority = -1 } +unwrap_used = "deny" + +[profile.dev] +panic = "abort" + +[profile.release] +opt-level = "z" # Optimize for size. +lto = true # Enable Link Time Optimization +codegen-units = 1 # Reduce number of codegen units to increase optimizations. +panic = "abort" # Abort on panic +strip = true # Automatically strip symbols from the binary. diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..7c224aa --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +hard_tabs=true diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..a30eb95 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}