-
-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathJustfile
More file actions
112 lines (96 loc) · 3.58 KB
/
Justfile
File metadata and controls
112 lines (96 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
template_dir := `mktemp -d`
# Lists all available commands.
list:
@just --list
# Update sponsors data
update-sponsors:
php scripts/update-sponsors-docs.php
# Regenerate the analyzer issue codes.
regen-analyzer-issue-codes:
rm -f crates/analyzer/src/code.rs
php scripts/regen-analyzer-issue-codes.php >> crates/analyzer/src/code.rs
rustfmt crates/analyzer/src/code.rs
# Builds the library in release mode.
build:
cargo build --release
# Builds the webassembly module.
build-wasm:
cd crates/wasm && wasm-pack build --release --out-dir pkg
# Detects problems using rustfmt, clippy, and cargo check, and runs the linter and analyzer.
check:
cargo run -- fmt --check
cargo run -- lint
cargo run -- analyze
cargo +nightly fmt --all -- --check --unstable-features
cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings
cargo +nightly check --workspace --locked
# Fixes linting problems automatically using clippy, cargo fix, and rustfmt.
fix:
cargo run -- lint --fix
cargo run -- analyze --fix
cargo run -- fmt
cargo +nightly clippy --workspace --all-targets --all-features --fix --allow-dirty --allow-staged
cargo +nightly fix --allow-dirty --allow-staged
cargo +nightly fmt --all -- --unstable-features
# Runs all tests in the workspace.
test:
cargo test --workspace --locked --all-targets
# Fuzz the PHP lexer. Seeds are drawn from the syntax/analyzer/formatter PHP fixtures.
fuzz-php-lexer:
cd crates/syntax/fuzz && cargo +nightly fuzz run lexer \
corpus/lexer \
../tests/fixtures \
../../analyzer/tests/cases \
../../formatter/tests/cases
# Fuzz the PHP parser. Seeds are drawn from the syntax/analyzer/formatter PHP fixtures.
fuzz-php-parser:
cd crates/syntax/fuzz && cargo +nightly fuzz run parser \
corpus/parser \
../tests/fixtures \
../../analyzer/tests/cases \
../../formatter/tests/cases
# Fuzz the Twig lexer.
fuzz-twig-lexer:
cd crates/twig-syntax/fuzz && cargo +nightly fuzz run lexer corpus/lexer seeds/lexer
# Fuzz the Twig parser.
fuzz-twig-parser:
cd crates/twig-syntax/fuzz && cargo +nightly fuzz run parser corpus/parser seeds/parser
# Fuzz the type lexer.
fuzz-type-lexer:
cd crates/type-syntax/fuzz && cargo +nightly fuzz run lexer corpus/lexer seeds/lexer
# Fuzz the type parser.
fuzz-type-parser:
cd crates/type-syntax/fuzz && cargo +nightly fuzz run parser corpus/parser seeds/parser
# Publishes all crates to crates.io in the correct order.
publish:
# Note: the order of publishing is important, as some crates depend on others.
cargo publish -p mago-casing
cargo publish -p mago-php-version
cargo publish -p mago-text-edit
cargo publish -p mago-atom
cargo publish -p mago-database
cargo publish -p mago-span
cargo publish -p mago-reporting
cargo publish -p mago-syntax-core
cargo publish -p mago-syntax
cargo publish -p mago-collector
cargo publish -p mago-type-syntax
cargo publish -p mago-twig-syntax
cargo publish -p mago-composer
cargo publish -p mago-docblock
cargo publish -p mago-formatter
cargo publish -p mago-names
cargo publish -p mago-semantics
cargo publish -p mago-fingerprint
cargo publish -p mago-codex
cargo publish -p mago-prelude
cargo publish -p mago-algebra
cargo publish -p mago-guard
cargo publish -p mago-analyzer
cargo publish -p mago-linter
cargo publish -p mago-orchestrator
cargo publish -p mago-wasm
cargo publish
# Cleans all build artifacts from the workspace.
clean:
cargo clean --workspace