|
| 1 | +set windows-shell := ["powershell.exe", "-NoLogo", "-Command"] |
| 2 | + |
| 3 | +# activate python venv |
| 4 | +[group("python")] |
| 5 | +[windows] |
| 6 | +venv: |
| 7 | + ./.env/Scripts/activate |
| 8 | + |
| 9 | +# activate python venv |
| 10 | +[group("python")] |
| 11 | +[linux] |
| 12 | +venv: |
| 13 | + . ./.env/bin/activate |
| 14 | + |
| 15 | +# install python bindings |
| 16 | +[group("python")] |
| 17 | +py-dev: |
| 18 | + maturin dev --manifest-path cpp-linter-py/Cargo.toml |
| 19 | + |
| 20 | +# run the test suite |
| 21 | +[group("code coverage")] |
| 22 | +test: |
| 23 | + cargo llvm-cov --no-report nextest --manifest-path cpp-linter-lib/Cargo.toml --lib |
| 24 | + |
| 25 | +# generate and open pretty coverage report |
| 26 | +[group("code coverage")] |
| 27 | +pretty-cov *args='': |
| 28 | + cargo llvm-cov report --json --output-path coverage.json |
| 29 | + @llvm-cov-pretty coverage.json {{ args }} |
| 30 | + |
| 31 | +# generate and open detailed coverage report |
| 32 | +[group("code coverage")] |
| 33 | +llvm-cov *args='': |
| 34 | + cargo llvm-cov report --html {{ args }} |
| 35 | + |
| 36 | +# This is useful for IDE gutter indicators of line coverage. |
| 37 | +# See Coverage Gutters ext in VSCode. |
| 38 | +# generate lcov.info |
| 39 | +[group("code coverage")] |
| 40 | +lcov: |
| 41 | + @cargo llvm-cov report --lcov --output-path lcov.info |
| 42 | + |
| 43 | +# serve docs |
| 44 | +[group("docs")] |
| 45 | +docs open='': |
| 46 | + @mdbook serve docs {{ open }} |
| 47 | + |
| 48 | +# build docs |
| 49 | +[group("docs")] |
| 50 | +docs-build: |
| 51 | + mdbook build docs --open |
| 52 | + |
| 53 | +# rust docs |
| 54 | +[group("docs")] |
| 55 | +docs-rs: |
| 56 | + cargo doc --no-deps --lib --manifest-path cpp-linter-lib/Cargo.toml --open |
| 57 | + |
| 58 | +# run cpp-linter native binary |
| 59 | +[group("bin")] |
| 60 | +run *args: |
| 61 | + cargo run --bin cpp-linter --manifest-path cpp-linter-lib/Cargo.toml -- {{ args }} |
| 62 | + |
| 63 | +# The tool parameter can be set to 'cross' when cross compiling. |
| 64 | + |
| 65 | +# build the native binary |
| 66 | +[group("bin")] |
| 67 | +build *args='': |
| 68 | + cargo build --bin cpp-linter --manifest-path cpp-linter-lib/Cargo.toml {{ args }} |
| 69 | + |
| 70 | +# run clippy and rustfmt |
| 71 | +lint: |
| 72 | + cargo clippy --allow-staged --allow-dirty --fix |
| 73 | + cargo fmt |
| 74 | + |
| 75 | +# bump version in root Cargo.toml |
| 76 | +bump component='patch': |
| 77 | + @python .github/workflows/bump_version.py {{ component }} |
0 commit comments