-- Generated by Gleam CI helpers. module CI.Component (run, version, check, format, format_check) 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. -- | @param arguments Literal native CLI argument tokens, passed without shell expansion. run :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), arguments :: Array String } -> Effect Contract.ExecutionResult run args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "ruff" "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. version :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String) } -> Effect Contract.ExecutionResult version args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "ruff" "version" json -- | Lint Python sources; fixes require fix=true. -- | @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. -- | @param config Named configuration selected by the native tool. -- | @param select Select supplied to the ruff check operation. -- | @param ignore Ignore supplied to the ruff check operation. -- | @param outputFormat Output Format supplied to the ruff check operation. -- | @param fix Fix supplied to the ruff check operation. -- | @param files Files selected for the native operation; paths are passed literally without shell expansion. Default: ["."]. check :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), config :: Maybe String, select :: Maybe String, ignore :: Maybe String, outputFormat :: Maybe String, fix :: Maybe Boolean, files :: Maybe (Array String) } -> Effect Contract.ExecutionResult check args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "ruff" "check" json -- | Format Python sources. -- | @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. -- | @param config Named configuration selected by the native tool. -- | @param lineLength Line Length supplied to the ruff format operation. -- | @param files Files selected for the native operation; paths are passed literally without shell expansion. Default: ["."]. format :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), config :: Maybe String, lineLength :: Maybe Int, files :: Maybe (Array String) } -> Effect Contract.ExecutionResult format args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "ruff" "format" json -- | Check Python formatting without writing 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. -- | @param config Named configuration selected by the native tool. -- | @param files Files selected for the native operation; paths are passed literally without shell expansion. Default: ["."]. format_check :: { project :: Maybe String, runDir :: String, executable :: Maybe String, timeoutMs :: Maybe Int, artifacts :: Maybe (Array String), config :: Maybe String, files :: Maybe (Array String) } -> Effect Contract.ExecutionResult format_check args = do json <- Contract.cliInput (Contract.encodeInput args) Native.executeWithSetup Dependencies.ensureFor "ruff" "format_check" json