-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor env guard and fix compilation #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e1960c4
9d2eef2
47fbcdb
032a791
b20f9aa
a86e272
b33662e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ | |
| //! parallel. | ||
|
|
||
| mod steps; | ||
| mod support; | ||
| mod util; | ||
| use cucumber::World as _; | ||
| use steps::{ | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| use comenq_lib::workflow::uses_goreleaser as workflow_uses_goreleaser; | ||||||||||||||||||||||||||||||||
| use cucumber::{World, given, then, when}; | ||||||||||||||||||||||||||||||||
| use regex::Regex; | ||||||||||||||||||||||||||||||||
| use serde_yaml::Value; | ||||||||||||||||||||||||||||||||
| use std::fs; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -40,8 +41,11 @@ fn triggers_on_tags(world: &mut ReleaseWorld) { | |||||||||||||||||||||||||||||||
| .expect("tags") | ||||||||||||||||||||||||||||||||
| .as_sequence() | ||||||||||||||||||||||||||||||||
| .expect("sequence"); | ||||||||||||||||||||||||||||||||
| let pattern = Regex::new(r"^v\*\.\*\.\*$").expect("compile regex"); | ||||||||||||||||||||||||||||||||
| assert!( | ||||||||||||||||||||||||||||||||
|
leynos marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||
| tags.iter() | ||||||||||||||||||||||||||||||||
| .any(|t| t.as_str() == Some("v[0-9]*.[0-9]*.[0-9]*")) | ||||||||||||||||||||||||||||||||
| .filter_map(|t| t.as_str()) | ||||||||||||||||||||||||||||||||
| .any(|t| pattern.is_match(t)), | ||||||||||||||||||||||||||||||||
| "missing semantic version tag pattern", | ||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
|
Comment on lines
+44
to
50
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix regex pattern for semantic version matching. The current regex pattern Apply this diff to fix the pattern: - let pattern = Regex::new(r"^v\*\.\*\.\*$").expect("compile regex");
+ let pattern = Regex::new(r"^v\d+\.\d+\.\d+$").expect("compile regex");This will properly match semantic version tags with the format "v{major}.{minor}.{patch}". 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Import change looks good, but verify unsafe usage in shared utility.
The migration to shared test utilities improves code organisation. However, ensure the
unsafeoperation intest_support::env_guard::remove_env_var(which callsstd::env::remove_var) is properly justified and documented according to the coding guidelines.🏁 Script executed:
Length of output: 265
Remove unnecessary
unsafeblock inremove_env_varThe
remove_env_varfunction wraps the safestd::env::remove_varcall in anunsafeblock. Eliminate this block to comply with our guideline of avoiding superfluousunsafeusage.• File: test-support/src/env_guard.rs
• Lines: 44–46
Suggested change:
📝 Committable suggestion
🤖 Prompt for AI Agents