Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add useful development targets to makefile #2979

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: Full Rust codebase checks

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"

on:
workflow_call:

Expand All @@ -16,9 +12,7 @@ jobs:
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2

- run: cargo check --workspace --examples --tests --benches --bins
- run: cargo fmt -- --check
- run: cargo clippy --workspace --all-targets
- run: make lint

check_c_warnings:
name: Check C warnings
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,25 @@ clean:
rm -f lib/src/*.o libtree-sitter.a libtree-sitter.$(SOEXT) libtree-sitter.$(SOEXTVER_MAJOR) libtree-sitter.$(SOEXTVER)

.PHONY: all install clean


##### Dev targets #####

test:
script/fetch-fixtures
script/generate-fixtures
script/test

test_wasm:
script/generate-fixtures-wasm
script/test-wasm

lint:
cargo check --workspace --all-targets
cargo fmt --all --check
cargo clippy --workspace --all-targets -- -D warnings

format:
cargo fmt --all

.PHONY: test test_wasm lint format