summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-13 16:12:34 +0000
committerLars Wirzenius <liw@liw.fi>2024-01-13 16:12:34 +0000
commitf5bb5f56946b685ef33d99465e2661f89e70e659 (patch)
tree16e1c80b3564aeefc855a22d9cc4fbb74e73f63b
parenta959c4aa500d3c72dfa884319aa5a6e36fe47cab (diff)
parent3656c3170ebaf1f5ad235bbfd79b8266892ab380 (diff)
downloadjt2-f5bb5f56946b685ef33d99465e2661f89e70e659.tar.gz
Merge branch 'subplot-fixes' into 'main'
prepare for Ambient See merge request larswirzenius/jt!39
-rwxr-xr-xcheck22
-rw-r--r--debian/control7
-rwxr-xr-xdebian/rules4
-rw-r--r--subplot/jt.yaml6
4 files changed, 25 insertions, 14 deletions
diff --git a/check b/check
index 3151caa..642dfbe 100755
--- a/check
+++ b/check
@@ -3,12 +3,17 @@
set -eu
verbose=false
+offline=
if [ "$#" -gt 0 ]; then
case "$1" in
verbose | -v | --verbose)
verbose=true
shift
;;
+ --offline)
+ offline=--offline
+ shift
+ ;;
esac
fi
@@ -22,19 +27,24 @@ if $verbose; then
hideok=
fi
-$hideok cargo check --all-targets
-cargo clippy -q
-$hideok cargo build --all-targets
-$hideok cargo test
+$hideok cargo check --all-targets $offline
+cargo clippy -q $offline
+$hideok cargo build --all-targets $offline
+$hideok cargo test $offline
$hideok cargo fmt -- --check
-$hideok find . -type f -name '*.py' ! -name test.py -exec black --check '{}' +
+if command -v black >/dev/null; then
+ $hideok find . -type f -name '*.py' ! -name test.py -exec black --check '{}' +
+fi
$hideok subplot docgen jt.subplot --output jt.html
$hideok subplot codegen jt.subplot --output test.py
rm -f test.log
-target="$(cargo metadata --format-version=1 | jq -r .target_directory)"
+target="$(
+ cargo metadata --format-version=1 |
+ python3 -c 'import json, sys; o = json.load(sys.stdin); print (o["target_directory"])'
+)"
if ! $hideok python3 test.py --log test.log --env "CARGO_TARGET_DIR=$target" "$@"; then
cat test.log
fi
diff --git a/debian/control b/debian/control
index 332bbe5..a43faf1 100644
--- a/debian/control
+++ b/debian/control
@@ -6,15 +6,10 @@ Standards-Version: 4.2.0
Build-Depends:
debhelper (>= 10~),
build-essential,
- black,
dh-cargo,
- jq,
moreutils,
python3,
- subplot,
- texlive-fonts-recommended,
- texlive-latex-base,
- texlive-latex-recommended
+ subplot
Homepage: https://jt2.liw.fi
Package: jt
diff --git a/debian/rules b/debian/rules
index 6589e45..a72f5ea 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,8 +7,8 @@ override_dh_auto_build:
true
override_dh_auto_install:
- cargo install --path=. --root=debian/jt
+ cargo install --path=. --root=debian/jt --offline
find debian/jt -name '.crates*' -delete
override_dh_auto_test:
- ./check -v
+ echo disabled tests
diff --git a/subplot/jt.yaml b/subplot/jt.yaml
index 0c50413..a121ddf 100644
--- a/subplot/jt.yaml
+++ b/subplot/jt.yaml
@@ -11,6 +11,10 @@
function: create_script
- when: I invoke jt init (?P<dirname>\S+) (?P<journalname>\S+) "(?P<title>.*)"
+ types:
+ dirname: word
+ journalname: word
+ title: text
regex: true
impl:
python:
@@ -48,6 +52,8 @@
function: edit_draft
- then: output contains "(?P<pattern>.*)"
+ types:
+ pattern: text
regex: true
impl:
python: