From 2f2af9df74fd42a50b49d50c87e7449c2d5e4ad6 Mon Sep 17 00:00:00 2001 From: svartalf Date: Fri, 27 Sep 2019 15:18:26 +0300 Subject: [PATCH 1/2] Triggering clippy lint --- .github/workflows/clippy_check.yml | 20 ++++++++++++++++++++ example/src/lib.rs | 11 ++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/clippy_check.yml diff --git a/.github/workflows/clippy_check.yml b/.github/workflows/clippy_check.yml new file mode 100644 index 0000000..8bee726 --- /dev/null +++ b/.github/workflows/clippy_check.yml @@ -0,0 +1,20 @@ +on: push +name: Clippy check +jobs: + clippy_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@1 + - id: component + uses: actions-rs/components-nightly@v1 + with: + component: clippy + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ steps.component.outputs.toolchain }} + override: true + - run: rustup component add clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features diff --git a/example/src/lib.rs b/example/src/lib.rs index 6940507..488b58a 100644 --- a/example/src/lib.rs +++ b/example/src/lib.rs @@ -18,6 +18,16 @@ pub fn pid() -> Pid { } } +// Specifically dumb function, just to trigger clippy +pub fn pid_is_valid(pid: Pid) -> bool { + let pid = pid as u32; + if pid < 0 { + return false; + } else { + return true; + } +} + #[cfg(test)] mod tests { use std::process; @@ -28,5 +38,4 @@ mod tests { fn test_pid_is_working() { assert_eq!(pid() as u32, process::id()); } - } \ No newline at end of file From 68ef433da258b17448bd1ee10e5e0b62e8e5fa59 Mon Sep 17 00:00:00 2001 From: svartalf Date: Fri, 27 Sep 2019 15:21:21 +0300 Subject: [PATCH 2/2] Typo --- .github/workflows/clippy_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clippy_check.yml b/.github/workflows/clippy_check.yml index 8bee726..987467f 100644 --- a/.github/workflows/clippy_check.yml +++ b/.github/workflows/clippy_check.yml @@ -4,7 +4,7 @@ jobs: clippy_check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@1 + - uses: actions/checkout@v1 - id: component uses: actions-rs/components-nightly@v1 with: