ci: use makefile for fmt
This commit is contained in:
parent
a5ef9ff64a
commit
cbe2b2a361
|
@ -15,16 +15,16 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- run: pip install black==20.8b1
|
||||
- run: pip install black==21.12b0
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
components: rustfmt
|
||||
- name: Check python formatting (black)
|
||||
run: black --check .
|
||||
run: make fmt_py
|
||||
- name: Check rust formatting (rustfmt)
|
||||
run: cargo fmt --all -- --check
|
||||
run: make fmt_rust
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
11
Makefile
11
Makefile
|
@ -1,4 +1,4 @@
|
|||
.PHONY: test test_py publish clippy lint fmt
|
||||
.PHONY: test test_py publish clippy lint fmt fmt_py fmt_rust
|
||||
|
||||
ALL_ADDITIVE_FEATURES = macros multiple-pymethods num-bigint num-complex hashbrown serde indexmap eyre anyhow
|
||||
|
||||
|
@ -14,10 +14,15 @@ test: lint test_py
|
|||
test_py:
|
||||
for example in examples/*/; do TOX_TESTENV_PASSENV=RUSTUP_HOME tox -e py -c $$example || exit 1; done
|
||||
|
||||
fmt:
|
||||
cargo fmt --all -- --check
|
||||
fmt_py:
|
||||
black . --check
|
||||
|
||||
fmt_rust:
|
||||
cargo fmt --all -- --check
|
||||
|
||||
fmt: fmt_rust fmt_py
|
||||
@true
|
||||
|
||||
clippy:
|
||||
cargo clippy --features="$(ALL_ADDITIVE_FEATURES)" --all-targets --workspace -- -Dwarnings
|
||||
cargo clippy --features="abi3 $(ALL_ADDITIVE_FEATURES)" --all-targets --workspace -- -Dwarnings
|
||||
|
|
Loading…
Reference in New Issue