intermodal/justfile
Casey Rodarmor f2a5f13729
Format with unstable rustfmt options
- Format with nightly rustfmt
- Enable unstable options in rustfmt.toml
- Turn off git text file detection, so newlines are always unix newlines

type: reform
2020-04-07 19:01:07 -07:00

93 lines
2.0 KiB
Makefile

default: watch
version := `sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/v\1/p' Cargo.toml | head -1`
bt := "0"
export RUST_BACKTRACE := bt
# watch filesystem for changes and rerun tests
watch:
cargo watch --exec test
# show stats about torrents at `PATH`
stats PATH:
cargo build --release
time ./target/release/imdl --unstable torrent stats --input {{PATH}}
push: check
! git branch | grep '* master'
git push github
# clean up feature branch BRANCH
done BRANCH:
git checkout master
git diff --no-ext-diff --quiet --exit-code
git pull --rebase github master
git diff --no-ext-diff --quiet --exit-code {{BRANCH}}
git branch -D {{BRANCH}}
test:
cargo test --all
clippy:
cargo clippy --all
fmt:
cargo +nightly fmt --all
lint:
./bin/lint
preview-readme:
grip -b README.md
# add git log messages to changelog
changes:
git log --pretty=format:%s >> CHANGELOG.md
dev-deps:
brew install grip
# update readme table of contents
update-toc:
cargo run --package update-readme toc
# update readme table of supported BEPs
update-supported-beps:
cargo run --package update-readme supported-beps
check-minimal-versions:
./bin/check-minimal-versions
check: test clippy lint check-minimal-versions
git diff --no-ext-diff --quiet --exit-code
cargo +nightly fmt --all -- --check
cargo run --package update-readme toc
git diff --no-ext-diff --quiet --exit-code
publish-check: check
cargo outdated --exit-code 1
git branch | grep '* master'
grep {{version}} CHANGELOG.md
publish: publish-check
cargo publish
git tag -a {{version}} -m 'Release {{version}}'
git push github {{version}}
# open github pages index
open-pages:
open docs/index.html
# retrieve large collection of torrents from the Internet Archive
get-torrents:
aria2c \
-d dat \
-x 10 \
'https://ia802701.us.archive.org/21/items/2014_torrent_archive_organized/torrent_archive_organized.zip'
# download bittorrent.org repository
get-beps:
git clone git@github.com:bittorrent/bittorrent.org.git tmp/bittorrent.org