Skip to content

rust

A set of tasks for a Rust project with Cargo

List of tasks

Tasks Description
rust:audit [RUST] Audit dependencies for security vulnerabilities. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:build [RUST] Build project with Cargo. Arguments: [ARGS|A=""] [RELEASE|R=n] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:check [RUST] Fast check of code without building binaries. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:clean [RUST] Remove build artifacts directory. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:doc [RUST] Build project documentation. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:format [RUST] Format code with rustfmt. Arguments: [ARGS|A=""] [CHECK|C=n] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:lint [RUST] Lint code with Clippy. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:run [RUST] Run binary target. Arguments: [ARGS|A=""] [RELEASE|R=n] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:test [RUST] Run unit and integration tests. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)
rust:update [RUST] Update dependencies in Cargo.lock. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

global variables

Variables Description Default value
IMAGE_RUST - rust:latest

rust:audit

[RUST] Audit dependencies for security vulnerabilities. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Audit dependencies for security vulnerabilities.
Usage: task rust:audit [ARGS|A=<args>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo audit (optional)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo with cargo-audit or docker

rust:build

[RUST] Build project with Cargo. Arguments: [ARGS|A=""] [RELEASE|R=n] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Build project with Cargo.
Usage: task rust:build [ARGS|A=<args>] [RELEASE|R=<y|n>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo build (optional)
RELEASE | R Build in release mode with --release (optional, by default no)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo or docker

rust:check

[RUST] Fast check of code without building binaries. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Fast check of code without building binaries.
Usage: task rust:check [ARGS|A=<args>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo check (optional)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo or docker

rust:clean

[RUST] Remove build artifacts directory. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Remove build artifacts directory.
Usage: task rust:clean [ARGS|A=<args>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo clean (optional)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo or docker

rust:doc

[RUST] Build project documentation. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Build project documentation.
Usage: task rust:doc [ARGS|A=<args>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo doc (optional)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo or docker

rust:format

[RUST] Format code with rustfmt. Arguments: [ARGS|A=""] [CHECK|C=n] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Format code with rustfmt.
Usage: task rust:format [ARGS|A=<args>] [CHECK|C=<y|n>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo fmt (optional)
CHECK | C Check formatting without writing changes (optional, by default no)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo with rustfmt component or docker

rust:lint

[RUST] Lint code with Clippy. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Lint code with Clippy.
Usage: task rust:lint [ARGS|A=<args>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo clippy (optional)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo with clippy component or docker

rust:run

[RUST] Run binary target. Arguments: [ARGS|A=""] [RELEASE|R=n] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Run binary target.
Usage: task rust:run [ARGS|A=<args>] [RELEASE|R=<y|n>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo run (optional)
RELEASE | R Run release binary with --release (optional, by default no)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo or docker

rust:test

[RUST] Run unit and integration tests. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Run unit and integration tests.
Usage: task rust:test [ARGS|A=<args>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo test (optional)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo or docker

rust:update

[RUST] Update dependencies in Cargo.lock. Arguments: [ARGS|A=""] [IMG|I=rust:latest] [PULL|P=n|N] (*)

[RUST] Update dependencies in Cargo.lock.
Usage: task rust:update [ARGS|A=<args>] [IMG|I=<docker_image>] [PULL|P=<n|N>]
Arguments Description
ARGS | A Arguments or options to pass to cargo update (optional)
IMG | I Docker image to use (optional, by default {{.IMAGE_RUST}})
PULL | P Pull docker image (optional, by default yes)

Requirements:

  • cargo or docker