Skip to content

Commit

Permalink
Update the toastfile
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchowfun committed Jun 13, 2024
1 parent 7704f2b commit 3d59ced
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions toast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3d59ced

Please sign in to comment.