Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tracing-subscriber = "0.3"
update-informer = "1.3"
dirs-next = "2.0"
serde = { version = "1.0", features = ["derive"] }
serde_yml = "0"
serde_yaml_ng = "0.10"
tealr = { version = "0.10.0", features = [
"mlua",
"mlua_lua54",
Expand Down
2 changes: 1 addition & 1 deletion app/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn lib_config(args: &GlobalArgs) -> anyhow::Result<Config> {
..Default::default()
},

false => serde_yml::from_str(yaml.as_str())
false => serde_yaml_ng::from_str(yaml.as_str())
.with_context(|| "Found Comtrya.yaml, but couldn't deserialize the YAML.")?,
};

Expand Down
2 changes: 1 addition & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -euo pipefail

cargo fmt
cargo clippy --tests
cargo clippy --all-features --all-targets
cargo test
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ rhai = { version = "1.24", features = ["serde"] }
schemars = "1.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yml = "0"
serde_yaml_ng = "0.10"
sha256 = "1.6"
tokio = "1.49"
toml = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions lib/src/actions/command/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ mod tests {
- hi
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::CommandRun(action)) => {
Expand All @@ -101,7 +101,7 @@ mod tests {
GOROOT: test
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::CommandRun(action)) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/directory/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mod tests {
#[test]
fn it_can_be_deserialized() {
let example_yaml = std::fs::File::open(get_manifest_dir().join("dircopy.yaml")).unwrap();
let mut manifest: Manifest = serde_yml::from_reader(example_yaml).unwrap();
let mut manifest: Manifest = serde_yaml_ng::from_reader(example_yaml).unwrap();

match manifest.actions.pop() {
Some(Actions::DirectoryCopy(action)) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/directory/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod tests {
#[test]
fn it_can_be_deserialized() {
let example_yaml = std::fs::File::open(get_manifest_dir().join("create.yaml")).unwrap();
let mut manifest: Manifest = serde_yml::from_reader(example_yaml).unwrap();
let mut manifest: Manifest = serde_yaml_ng::from_reader(example_yaml).unwrap();

match manifest.actions.pop() {
Some(Actions::DirectoryCreate(action)) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/directory/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ mod tests {
target: a
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::DirectoryRemove(action)) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/actions/file/chown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mod tests {
user: test
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();
match actions.pop() {
Some(Actions::FileChown(action)) => {
assert_eq!("/home/test/one", action.action.path);
Expand All @@ -85,7 +85,7 @@ mod tests {
group: test
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();
match actions.pop() {
Some(Actions::FileChown(action)) => {
assert_eq!("/home/test/one", action.action.path);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/actions/file/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ mod tests {
chmod: "0777"
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileCopy(action)) => {
Expand All @@ -211,7 +211,7 @@ mod tests {
owned_by_group: test
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileCopy(action)) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/actions/file/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ mod tests {
to: b
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileDownload(action)) => {
Expand All @@ -150,7 +150,7 @@ mod tests {
owned_by_group: test
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileDownload(action)) => {
Expand Down
8 changes: 4 additions & 4 deletions lib/src/actions/file/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ mod tests {
target: b
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileLink(action)) => {
Expand All @@ -180,7 +180,7 @@ mod tests {
to: b
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileLink(action)) => {
Expand Down Expand Up @@ -253,9 +253,9 @@ mod tests {
let number_of_files: usize = rng.random_range(3..9);

for i in 0..number_of_files {
let path = source_dir.clone().join(format!("{}.txt", i));
let path = source_dir.clone().join(format!("{i}.txt"));
let mut file = std::fs::File::create(path).unwrap();
writeln!(file, "Random {}", i).unwrap();
writeln!(file, "Random {i}").unwrap();
}

let manifest: Manifest = Manifest {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/file/remove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mod tests {
target: a
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileRemove(action)) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/file/unarchive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mod tests {
to: b
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::FileUnarchive(action)) => {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl Display for Actions {
Actions::Plugin(_) => "plugin",
};

write!(f, "{}", name)
write!(f, "{name}")
}
}

Expand All @@ -271,7 +271,7 @@ pub struct ActionError {
impl<E: std::error::Error> From<E> for ActionError {
fn from(e: E) -> Self {
ActionError {
message: format!("{}", e),
message: format!("{e}"),
}
}
}
Expand Down Expand Up @@ -301,7 +301,7 @@ actions:
- where: Debian
command: halt
"#;
let m: Manifest = serde_yml::from_str(content).unwrap();
let m: Manifest = serde_yaml_ng::from_str(content).unwrap();

let action = &m.actions[0];

Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/package/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ mod tests {
- bash
"#;

let mut actions: Vec<Actions> = serde_yml::from_str(yaml).unwrap();
let mut actions: Vec<Actions> = serde_yaml_ng::from_str(yaml).unwrap();

match actions.pop() {
Some(Actions::PackageInstall(action)) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/actions/package/providers/aptitude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ impl PackageProvider for Aptitude {
let key = repository.clone().key.unwrap();

let key_name = key.name.unwrap_or_else(|| digest(&*key.url));
let key_path = format!("/usr/share/keyrings/{}.asc", key_name);
let key_path = format!("/usr/share/keyrings/{key_name}.asc");

signed_by = format!("signed-by={}", key_path);
signed_by = format!("signed-by={key_path}");

steps.push(Step {
atom: Box::new(Exec {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/package/providers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Default for PackageProviders {
fn default() -> Self {
let info = os_info::get();

println!("Info: {:?}", info);
println!("Info: {info:?}");

match info.os_type() {
// Arch Variants
Expand Down
10 changes: 5 additions & 5 deletions lib/src/actions/plugin/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Display for Version {
Version::Tagged(tag) => tag.as_str(),
};

write!(f, "{}", version)
write!(f, "{version}")
}
}

Expand Down Expand Up @@ -174,7 +174,7 @@ impl Source for Repo {
},
Version::Latest => repo.head_tree()?,
Version::Tagged(ref version) => repo
.find_reference(&format!("tags/{}", version))?
.find_reference(&format!("tags/{version}"))?
.peel_to_tree()?,
};

Expand Down Expand Up @@ -244,8 +244,8 @@ pub enum RepoOrDir {
impl Display for RepoOrDir {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
RepoOrDir::Repo(repo) => write!(f, "{}", repo),
RepoOrDir::Dir(dir) => write!(f, "{}", dir),
RepoOrDir::Repo(repo) => write!(f, "{repo}"),
RepoOrDir::Dir(dir) => write!(f, "{dir}"),
RepoOrDir::Invalid => write!(f, "Invalid Repo or Directory"),
}
}
Expand Down Expand Up @@ -297,7 +297,7 @@ impl Plugin {

impl Display for Plugin {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Plugin: {:?}", self)
write!(f, "Plugin: {self:?}")
}
}

Expand Down
3 changes: 1 addition & 2 deletions lib/src/atoms/file/unarchive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ impl std::fmt::Display for Unarchive {

write!(
f,
"The archive {} to be decompressed to {}",
origin_path, dest_path
"The archive {origin_path} to be decompressed to {dest_path}"
)
}
}
2 changes: 1 addition & 1 deletion lib/src/contexts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub fn to_rhai(context: &Contexts) -> rhai::Scope<'_> {
let dynamic = match rhai::serde::to_dynamic(v) {
Ok(dynamic) => dynamic,
Err(error) => {
panic!("Failed to convert context value to dynamic: {}", error);
panic!("Failed to convert context value to dynamic: {error}");
}
};

Expand Down
2 changes: 1 addition & 1 deletion lib/src/contexts/privilege.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Display for Privilege {
Privilege::Doas => "doas".to_string(),
Privilege::Run0 => "run0".to_string(),
};
write!(f, "{}", str)
write!(f, "{str}")
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/contexts/variable_include/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub fn yaml_values(url: &Url, contexts: &mut HashMap<String, String>) -> Result<
let path = url.path();

let contents = std::fs::read_to_string(path)?;
let values: HashMap<String, Value> = serde_yml::from_str(&contents)?;
let values: HashMap<String, Value> = serde_yaml_ng::from_str(&contents)?;

for (key, value) in values {
contexts.insert(key.to_string(), value.to_string());
Expand Down
Loading