Merge pull request #597 from evandroforks/add_missing_check

Fixed rspy check not being called
This commit is contained in:
Damien Elmes 2020-05-04 13:38:58 +10:00 committed by GitHub
commit 95800b5b8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 12 deletions

View file

@ -52,7 +52,7 @@ BUILDFLAGS := --release --strip
DEVFLAGS := $(BUILDFLAGS) DEVFLAGS := $(BUILDFLAGS)
RUNFLAGS := RUNFLAGS :=
CHECKABLE_PY := pylib qt CHECKABLE_PY := pylib qt
CHECKABLE_RS := rslib CHECKABLE_RS := rslib rspy
DEVEL := rslib rspy pylib qt DEVEL := rslib rspy pylib qt
.PHONY: all .PHONY: all
@ -155,14 +155,8 @@ clean-dist: buildhash
check: pyenv buildhash prepare check: pyenv buildhash prepare
@set -eu -o pipefail ${SHELLFLAGS}; \ @set -eu -o pipefail ${SHELLFLAGS}; \
.github/scripts/trailing-newlines.sh; \ .github/scripts/trailing-newlines.sh; \
$(SUBMAKE) -C rslib develop; \
for dir in $(CHECKABLE_RS); do \
$(SUBMAKE) -C $$dir check; \
done; \
. "${ACTIVATE_SCRIPT}"; \ . "${ACTIVATE_SCRIPT}"; \
$(SUBMAKE) -C rspy develop; \ for dir in $(CHECKABLE_RS) $(CHECKABLE_PY); do \
$(SUBMAKE) -C pylib develop; \
for dir in $(CHECKABLE_PY); do \
$(SUBMAKE) -C $$dir check; \ $(SUBMAKE) -C $$dir check; \
done; done;
@echo @echo

View file

@ -17,7 +17,7 @@ $(shell mkdir -p .build)
all: check all: check
check: ftl/repo .build/check check: .build/check
fix: fix:
cargo fmt cargo fmt
@ -41,7 +41,7 @@ RUST_TOOLCHAIN := $(shell cat rust-toolchain)
rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN) rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN)
@touch $@ @touch $@
.build/check: .build/rs-tools $(ALL_SOURCE) .build/check: ftl/repo .build/rs-tools $(ALL_SOURCE)
cargo test --lib -- --nocapture cargo test --lib -- --nocapture
cargo fmt -- --check cargo fmt -- --check
cargo clippy -- -D warnings cargo clippy -- -D warnings

View file

@ -74,6 +74,8 @@ build: .build/build
check: .build/check check: .build/check
clippy: .build/clippy
fix: fix:
cargo fmt cargo fmt
@ -90,9 +92,16 @@ RUST_TOOLCHAIN := $(shell cat rust-toolchain)
rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN) rustup component add clippy-preview --toolchain $(RUST_TOOLCHAIN)
@touch $@ @touch $@
.build/check: build # we should not call clippy because it break things when running make check Mac OS
# https://github.com/ankitects/anki/pull/597
.build/check: .build/develop
cargo fmt -- --check cargo fmt -- --check
cargo clippy -- -D warnings @touch $@
# cargo clippy also run build.rs, thus it must be called using the BUILD_VARIABLES
.build/clippy: $(DEPS)
${BUILD_VARIABLES} \
cargo clippy -- -D warnings
@touch $@ @touch $@
VER := $(shell cat ../meta/version) VER := $(shell cat ../meta/version)