-- Generated by Gleam CI helpers. module CI.Component (run, version, format, check, cargo_fmt) where import Prelude import CI.Contract as Contract import Data.Maybe (Maybe) import Effect (Effect) import CI.ModuleDependencies as Dependencies import 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.ExecutionResult run 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.ExecutionResult version 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.ExecutionResult format 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.ExecutionResult check 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.ExecutionResult cargo_fmt args = do json <- Contract.csvFields [ "artifacts" ] (Contract.encodeInput args) >>= Contract.cliInput Native.executeWithSetup Dependencies.ensureFor "rustfmt" "cargo_fmt" json