pub struct IncludeRef {
pub include_ref: String,
pub run: String,
pub args: Option<String>,
pub env: BTreeMap<String, String>,
pub name: Option<String>,
}Expand description
A reference to a value in an included external file, used as a hook command.
The value at run (dot-notation path) is extracted from the file and used as the
shell command. Optional args are appended to that command. Optional env sets
environment variables for the invocation.
Example:
hooks:
pre-commit:
commands:
- $include: packagejson # references include with ref: packagejson
run: scripts.lint # navigates to scripts → lint in the file
args: "--fix" # appended to the resolved command
env:
NODE_ENV: production
name: lint # optional display name (defaults to last segment of run)Fields§
§include_ref: StringName of the include to reference (must match an IncludeEntry with this ref).
run: StringDot-notation path to the value in the file (e.g. scripts.lint).
args: Option<String>Extra arguments appended to the resolved command string.
env: BTreeMap<String, String>Environment variables set for this command invocation.
name: Option<String>Optional display name. Defaults to the last segment of run.
Trait Implementations§
Source§impl Clone for IncludeRef
impl Clone for IncludeRef
Source§fn clone(&self) -> IncludeRef
fn clone(&self) -> IncludeRef
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IncludeRef
impl Debug for IncludeRef
Source§impl<'de> Deserialize<'de> for IncludeRef
impl<'de> Deserialize<'de> for IncludeRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for IncludeRef
impl JsonSchema for IncludeRef
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for IncludeRef
impl RefUnwindSafe for IncludeRef
impl Send for IncludeRef
impl Sync for IncludeRef
impl Unpin for IncludeRef
impl UnsafeUnpin for IncludeRef
impl UnwindSafe for IncludeRef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more