From eb82ae603d41eb6e5893b2be41c3b6a843643aff Mon Sep 17 00:00:00 2001 From: Eric Sheppard Date: Fri, 2 Sep 2022 22:03:36 +1000 Subject: [PATCH] adjust lint workflow --- .github/workflows/lint.yml | 23 +++++++++++------------ ci/lint.sh | 15 --------------- 2 files changed, 11 insertions(+), 27 deletions(-) delete mode 100755 ci/lint.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 55e6c6ce..5ef8d54a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,8 +2,13 @@ name: lint on: push: - branches: [main, master, 0.4.x] + branches: [main, 0.4.x] pull_request: + paths: + - "**.rs" + - .github/** + - .ci/** + - Cargo.toml jobs: lint: @@ -11,15 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v1 - - name: Lint - run: bash ci/lint.sh - - name: Run ShellCheck - uses: ludeeus/action-shellcheck@0.3.0 - with: - check_together: "y" + - run: cargo fmt -- --check --color=always + - run: cargo clippy --color=always -- -D warnings -A clippy::manual-non-exhaustive + env: + RUSTFLAGS: "-Dwarnings" diff --git a/ci/lint.sh b/ci/lint.sh deleted file mode 100755 index f028c211..00000000 --- a/ci/lint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# shellcheck source=ci/_shlib.sh -source "${BASH_SOURCE[0]%/*}/_shlib.sh" - -main() { - # rustflags are present because of: https://github.com/rust-lang/rust-clippy/issues/5749 - runt env RUSTFLAGS="-Dwarnings" cargo clippy --color=always -- -D warnings -A clippy::manual-non-exhaustive - runt cargo fmt -- --check --color=always - runv git diff --exit-code -- README.md -} - -main