Something went wrong. Try again.
A collection of +180 reusable WebAssembly modules for building composable CI/CD pipelines with FluentCI fluentci.io/modules
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576-- Generated by Gleam CI helpers.module CI.Component (run, version, format, check, cargo_fmt) where
import Preludeimport CI.Contract as Contractimport Data.Maybe (Maybe)import Effect (Effect)import CI.ModuleDependencies as Dependenciesimport CI.CLI as Native
-- | Execute arbitrary literal CLI arguments.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.-- | @param arguments Literal native CLI argument tokens, passed without shell expansion. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.run :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, arguments :: String } -> Effect Contract.ExecutionResultrun args = do json <- Contract.csvFields [ "artifacts", "arguments" ] (Contract.encodeInput args) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "rustfmt" "run" json
-- | Print the CLI version.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.version :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String } -> Effect Contract.ExecutionResultversion args = do json <- Contract.csvFields [ "artifacts" ] (Contract.encodeInput args) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "rustfmt" "version" json
-- | Format explicit Rust source files.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.-- | @param edition Edition supplied to the rustfmt format operation. Allowed values: 2015, 2018, 2021, 2024.-- | @param configPath Config Path supplied to the rustfmt format operation.-- | @param config Named configuration selected by the native tool.-- | @param files Files selected for the native operation; paths are passed literally without shell expansion. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.format :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, edition :: Maybe String, configPath :: Maybe String, config :: Maybe String, files :: String } -> Effect Contract.ExecutionResultformat args = do json <- Contract.csvFields [ "artifacts", "files" ] (Contract.encodeInput args) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "rustfmt" "format" json
-- | Check explicit Rust source files.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.-- | @param edition Edition supplied to the rustfmt check operation. Allowed values: 2015, 2018, 2021, 2024.-- | @param configPath Config Path supplied to the rustfmt check operation.-- | @param files Files selected for the native operation; paths are passed literally without shell expansion. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.check :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, edition :: Maybe String, configPath :: Maybe String, files :: String } -> Effect Contract.ExecutionResultcheck args = do json <- Contract.csvFields [ "artifacts", "files" ] (Contract.encodeInput args) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "rustfmt" "check" json
-- | Format a Cargo package or workspace.-- | @param project Working directory containing the source checkout; defaults to the current directory. Default: ".".-- | @param runDir Fresh directory for this invocation’s execution report and task logs; must not already exist.-- | @param executable Native CLI executable name or absolute path; defaults to this operation’s tool.-- | @param timeoutMs Maximum task duration in milliseconds; defaults to 900000. Default: 900000.-- | @param artifacts Output artifacts to collect as NAME=PATH entries; names must be unique. Comma-separated values; whitespace is trimmed and empty entries are rejected. CSV quotes preserve literal commas.-- | @param all All supplied to the rustfmt cargo_fmt operation.-- | @param check Check supplied to the rustfmt cargo_fmt operation.-- | @param manifestPath Manifest Path supplied to the rustfmt cargo_fmt operation.cargo_fmt :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe String, all :: Maybe Boolean, check :: Maybe Boolean, manifestPath :: Maybe String } -> Effect Contract.ExecutionResultcargo_fmt args = do json <- Contract.csvFields [ "artifacts" ] (Contract.encodeInput args) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "rustfmt" "cargo_fmt" json