Run --no-default-features clippy for every crate

This commit is contained in:
Edouard Oger 2020-01-03 10:21:37 -05:00
Родитель a072aed017
Коммит 18c6e3ea37
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: A2F740742307674A
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -257,10 +257,17 @@ jobs:
- run: rustup component add clippy - run: rustup component add clippy
- run: cargo clippy --version - run: cargo clippy --version
- run: cargo clippy --all --all-targets --all-features -- -D warnings -A clippy::redundant_clone - run: cargo clippy --all --all-targets --all-features -- -D warnings -A clippy::redundant_clone
# Run clippy without any features so that we still lint things that are # --no-default-features does not work on a workspace, so we do it for every crate.
# behind a `#[cfg(not(feature = "..."))]`, which will always be false with - run: |
# --all-features. for package in $(cargo metadata --format-version 1 | jq -r '.workspace_members[] | sub(" .*$"; "")'); do
- run: cargo clippy --all --all-targets --no-default-features -- -D warnings -A clippy::redundant_clone # For some reason cargo even rejects `-p package` for this, so we
# have to pull out the manifest... There's probably a way to make
# jq do this as part of the prev expression if you know how to use
# it, but whatever.
manifest=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == $pkg) | .manifest_path' --arg pkg $package)
echo "## no-default-features clippy for $package (manifest @ $manifest)"
cargo clippy --manifest-path $manifest --all-targets --no-default-features -- -D warnings -A clippy::redundant_clone
done
Lint Bash scripts: Lint Bash scripts:
docker: docker:
- image: koalaman/shellcheck-alpine:stable - image: koalaman/shellcheck-alpine:stable