From 3d59cedd2da88b94aba1201c618902fd20ac7be4 Mon Sep 17 00:00:00 2001 From: Stephan Boyer Date: Thu, 13 Jun 2024 01:39:52 -0700 Subject: [PATCH] Update the toastfile --- toast.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/toast.yml b/toast.yml index 1e94215..a590dc7 100644 --- a/toast.yml +++ b/toast.yml @@ -2,8 +2,8 @@ image: ubuntu:24.04 default: build user: user command_prefix: | - # Make Bash log commands and not silently ignore errors. - set -euxo pipefail + # Make not silently ignore errors. + set -euo pipefail # Load the Rust startup file, if it exists. if [ -f "$HOME/.cargo/env" ]; then @@ -22,6 +22,9 @@ command_prefix: | # according to this page: # https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu.html cargo-fmt () { cargo +nightly-2024-05-04 --frozen --offline fmt --all -- "$@"; } + + # Make Bash log commands. + set -x tasks: install_packages: description: Install system packages. @@ -146,9 +149,6 @@ tasks: - artifacts - target command: | - # Lint the code with Clippy. - cargo-offline clippy --all-features --all-targets --workspace - # Check that the grammar is unambiguous with Bison. bison --verbose --report=itemset --report=lookahead --warnings=all -Werror grammar.y || \ (cat grammar.output && false) @@ -160,14 +160,18 @@ tasks: # Lint shell files with ShellCheck. find . -type f -name '*.sh' | xargs shellcheck + # Lint the code with Clippy. + cargo-offline clippy --all-features --all-targets --workspace + # Check code formatting with Rustfmt. See [ref:format_macros] for an explanation of the `rg` # commands. - rg '!\(' --type rust --files-with-matches src | xargs sed -i 's/!(/_(/g' + rg --type rust --files-with-matches '' src | xargs sed -i 's/!(/_(/g' + rg --type rust --files-with-matches '' src | xargs sed -i 's/^\([^ (]*\)_(/\1!(/g' if ! cargo-fmt --check; then echo 'ERROR: Please correct the formatting errors above.' 1>&2 exit 1 fi - rg '_\(' --type rust --files-with-matches src | xargs sed -i 's/_(/!(/g' + rg --type rust --files-with-matches '' src | xargs sed -i 's/_(/!(/g' # Forbid unconsolidated `use` declarations. if rg --line-number --type rust --multiline '}[[:space]]*;[[:space:]]*\n[[:space:]]*use' src @@ -231,9 +235,10 @@ tasks: command: | # Format the code with Rustfmt. We temporarily convert macro invocations into function calls # so Rustfmt's `trailing_comma` feature applies to macro arguments [tag:format_macros]. - rg '!\(' --type rust --files-with-matches src | xargs sed -i 's/!(/_(/g' + rg --type rust --files-with-matches '' src | xargs sed -i 's/!(/_(/g' + rg --type rust --files-with-matches '' src | xargs sed -i 's/^\([^ (]*\)_(/\1!(/g' cargo-fmt - rg '_\(' --type rust --files-with-matches src | xargs sed -i 's/_(/!(/g' + rg --type rust --files-with-matches '' src | xargs sed -i 's/_(/!(/g' release: description: Build and output the release binaries for Linux.