diff --git a/.drone.yml b/.drone.yml index 96cd379..ec31c28 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,19 +6,35 @@ platform: steps: - name: build [debug] - image: rust:alpine + image: rust:1.71.1-slim-bookworm commands: - rustc --version - cargo --version - cargo build --verbose --all - name: test [debug] - image: rust:alpine + image: rust:1.71.1-slim-bookworm commands: - rustc --version - cargo --version - cargo test --verbose --all +- name: lint-clippy [debug] + image: rust:1.71.1-alpine + commands: + - rustc --version + - cargo --version + - rustup component add clippy + - cargo clippy --verbose --all + +- name: format [debug] + image: rust:1.71.1-alpine + commands: + - rustc --version + - cargo --version + - rustup component add rustfmt + - cargo fmt --verbose --all --check + --- kind: pipeline name: arm64 [debug] @@ -28,19 +44,41 @@ platform: steps: - name: build [debug] - image: rust:alpine + image: rust:1.71.1-slim-bookworm commands: - rustc --version - cargo --version - cargo build --verbose --all - name: test [debug] - image: rust:alpine + image: rust:1.71.1-slim-bookworm commands: - rustc --version - cargo --version - cargo test --verbose --all +- name: lint-clippy [debug] + image: rust:1.71.1-alpine + commands: + - rustc --version + - cargo --version + # Stupid workarounds, for stupid problems + - echo "nameserver 1.1.1.1" >> /etc/resolv.conf + - echo "nameserver 1.0.0.1" >> /etc/resolv.conf + - rustup component add clippy + - cargo clippy --verbose --all + +- name: format [debug] + image: rust:1.71.1-alpine + commands: + - rustc --version + - cargo --version + # Stupid workarounds, for stupid problems + - echo "nameserver 1.1.1.1" >> /etc/resolv.conf + - echo "nameserver 1.0.0.1" >> /etc/resolv.conf + - rustup component add rustfmt + - cargo fmt --verbose --all --check + --- kind: pipeline name: amd64 [release] @@ -50,7 +88,7 @@ platform: steps: - name: build and test [release] - image: rust:alpine + image: rust:1.71.1-slim-bookworm commands: - rustc --version - cargo --version @@ -65,7 +103,7 @@ platform: steps: - name: build and test [release] - image: rust:alpine + image: rust:1.71.1-slim-bookworm commands: - rustc --version - cargo --version diff --git a/Cargo.toml b/Cargo.toml index 734c69f..8d023fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,3 +6,15 @@ 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" # https://rust-lang.github.io/rust-clippy/master/index.html#/enum_glob_use +pedantic = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/?groups=pedantic +nursery = "deny" # wip lints: https://rust-lang.github.io/rust-clippy/master/index.html#/?groups=nursery +unwrap_used = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/unwrap_used +missing_const_for_fn = "warn" # https://rust-lang.github.io/rust-clippy/master/index.html#/missing_const_for_fn +missing_assert_message = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/missing_assert_message +missing_errors_doc = "deny" # https://rust-lang.github.io/rust-clippy/master/index.html#/missing_assert_message \ No newline at end of file diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..18d655e --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +hard_tabs = true \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index e7a11a9..a30eb95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,3 @@ fn main() { - println!("Hello, world!"); + println!("Hello, world!"); }