mirror of
https://github.com/danog/parser.git
synced 2024-12-02 09:27:50 +01:00
chore: add makefile
Signed-off-by: azjezz <azjezz@protonmail.com>
This commit is contained in:
parent
2e68dd8f35
commit
e3960994d0
6
.github/workflows/tests.yml
vendored
6
.github/workflows/tests.yml
vendored
@ -34,9 +34,7 @@ jobs:
|
|||||||
|
|
||||||
- name: check
|
- name: check
|
||||||
if: matrix.rust == 'stable'
|
if: matrix.rust == 'stable'
|
||||||
run: |
|
run: make lint
|
||||||
cargo fmt --all -- --check
|
|
||||||
cargo clippy
|
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
run: ./meta/test --all -- --skip third_party
|
run: make test
|
||||||
|
3
.github/workflows/third-party-tests.yml
vendored
3
.github/workflows/third-party-tests.yml
vendored
@ -32,4 +32,5 @@ jobs:
|
|||||||
uses: Swatinem/rust-cache@v2.0.0
|
uses: Swatinem/rust-cache@v2.0.0
|
||||||
|
|
||||||
- name: test third-party
|
- name: test third-party
|
||||||
run: ./meta/test third_party
|
run: make test-third-party
|
||||||
|
|
||||||
|
35
Makefile
Normal file
35
Makefile
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# If the first argument is "dump"...
|
||||||
|
ifeq (dump,$(firstword $(MAKECMDGOALS)))
|
||||||
|
# use the rest as arguments for "dump"
|
||||||
|
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
|
||||||
|
# ...and turn them into do-nothing targets
|
||||||
|
$(eval $(RUN_ARGS):;@:)
|
||||||
|
endif# If the first argument is "dump"...
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
|
||||||
|
help:
|
||||||
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
|
lint: ## lint code for formatting issues.
|
||||||
|
cargo fmt --all -- --check
|
||||||
|
cargo clippy
|
||||||
|
|
||||||
|
fix: ## fix linting problems.
|
||||||
|
cargo fmt
|
||||||
|
cargo clippy --fix --allow-dirty --allow-staged
|
||||||
|
|
||||||
|
dump: ## dump AST for given files.
|
||||||
|
cargo run --bin php-parser-rs -- $(RUN_ARGS)
|
||||||
|
|
||||||
|
snapshot: ## dump a snapshot for intergration tests.
|
||||||
|
cargo run --bin snapshot
|
||||||
|
|
||||||
|
test: ## run integration tests, use filter="..." argument to filter out a specific test.
|
||||||
|
BUILD_INTEGRATION_TESTS="1" cargo build
|
||||||
|
cargo test --all $(filter) -- --skip third_party
|
||||||
|
|
||||||
|
test-third-party: ## run integration tests against third-party libraries.
|
||||||
|
BUILD_INTEGRATION_TESTS="1" cargo build
|
||||||
|
cargo test third_party
|
@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
cargo run --bin snapshot
|
|
Loading…
Reference in New Issue
Block a user