diff --git a/.gitea/workflows/checks.yaml b/.gitea/workflows/checks.yaml new file mode 100644 index 0000000..2432209 --- /dev/null +++ b/.gitea/workflows/checks.yaml @@ -0,0 +1,38 @@ +name: "Code Checks" +on: + pull_request: + +jobs: + # Check formatting with rustfmt + formatting: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Ensure rustfmt is installed and setup problem matcher + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + - name: Rustfmt Check + uses: actions-rust-lang/rustfmt@v1 + + # Check code with clippy + clippy: + name: cargo clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Ensure clippy is installed and setup problem matcher + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: clippy + - run: cargo clippy -- -D warnings + + # Run tests + test: + name: cargo test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo test \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index eac4b66..2f0e8c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ #![warn(clippy::pedantic)] -// #![allow(clippy::missing_errors_doc)] +#![allow(clippy::let_underscore_untyped)] // false positive in stable use std::{ fmt::Debug,