From de415d372959b7e6fc6b2f6c95f0c21e5010348d Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 15 Sep 2023 06:42:25 -0700 Subject: [PATCH] eval/nixpkgs: add note about why the extra curly braces are necessary --- ofborg/src/tasks/eval/nixpkgs.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ofborg/src/tasks/eval/nixpkgs.rs b/ofborg/src/tasks/eval/nixpkgs.rs index 5ffaa9c..b126acb 100644 --- a/ofborg/src/tasks/eval/nixpkgs.rs +++ b/ofborg/src/tasks/eval/nixpkgs.rs @@ -16,7 +16,6 @@ use crate::tasks::evaluate::{get_prefix, make_gist, update_labels}; use std::path::Path; -use brace_expand::brace_expand; use chrono::Utc; use hubcaps::checks::{CheckRunOptions, CheckRunState, Conclusion, Output}; use hubcaps::gists::Gists; @@ -626,7 +625,10 @@ fn parse_commit_messages(messages: &[String]) -> Vec { // Convert "foo: some notes" in to "foo" line.split_once(':').map(|(pre, _)| pre.trim()) }) - .flat_map(|line| brace_expand(&format!("{{{}}}", line))) + // NOTE: This transforms `{foo,bar}` into `{{foo,bar}}` and `foo,bar` into `{foo,bar}`, + // which allows both the old style (`foo,bar`) and the new style (`{foo,bar}`) to expand to + // `foo` and `bar`. + .flat_map(|line| brace_expand::brace_expand(&format!("{{{}}}", line))) .map(|line| line.trim().to_owned()) .collect() }