From 52ea9c4a485f7e5c1a95d739dfa61aa2a1ce49c7 Mon Sep 17 00:00:00 2001 From: Jan Scheer Date: Sat, 29 May 2021 14:21:32 +0200 Subject: [PATCH] CI: set MSRV and "--target" for clippy * add "clippy.toml" in order to set MSRV for clippy linting this works only if clippy is invoked with "+nightly" * add "--target" to clippy in order to also lint tests --- .github/workflows/CICD.yml | 2 +- clippy.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 clippy.toml diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 804720bea..8bc106e34 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -94,7 +94,7 @@ jobs: run: | # `clippy` testing # * convert any warnings to GHA UI annotations; ref: - S=$(cargo clippy ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -- -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::warning file=\2,line=\3,col=\4::WARNING: \`cargo clippy\`: \1/p;" -e '}' ; } + S=$(cargo +nightly clippy --target=${{ matrix.job.target }} ${{ matrix.job.cargo-options }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -- -D warnings 2>&1) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n -e '/^error:/{' -e "N; s/^error:[[:space:]]+(.*)\\n[[:space:]]+-->[[:space:]]+(.*):([0-9]+):([0-9]+).*$/::warning file=\2,line=\3,col=\4::WARNING: \`cargo clippy\`: \1/p;" -e '}' ; } min_version: name: MinRustV # Minimum supported rust version diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..0a0a69a41 --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +msrv = "1.43.1"