fix(#351) install via commit(-ish)/hash#352
Conversation
|
This was my initial call too. I figured to check other sections of the CodeBase as I've been working with it on and off for awhile now & figured I'd triple check the actual RegEx that we're compiling. I would say it's a bug as we're not (originally) enforcing the existence of the full stop during parsing. Rust aims to move as much of its validation logic, or really any logic that it can, to compile time, over procedural validations and relying on ordering of checks. Procedural validations can be dangerous in that they allow for invalid states to exist (often way too far into the program lifespan). Rust has ample tools to enforce this via enums & matches-even things like the Ord trait are available if so desired. Relying on match check ordering without a way to enforce it at compile time is bugs waiting to happen for sure. |
e2866d7 to
c0c74dc
Compare
install via commit(-ish)/hashinstall via commit(-ish)/hash
686e882 to
4306b5e
Compare
|
Just so im up to date with the approach used to fix the issue, to clarify the issue, the thing that failed identifying the hash was because the previous regex pattern didn't enforce dots? |
|
Correct, I've tested this locally with all commands that make use of the call. |
MordechaiHadad
left a comment
There was a problem hiding this comment.
Good additional rewrite, I wonder why do you prefer () unit type instead of _ placeholder for match exhaustion, and why if let Some(x) {} else {} over match
|
@MordechaiHadad - The unit value ( I presume you're referring to 450-451 in The |
4306b5e to
a7338f9
Compare
Oh damn you already changed lmao, I was okay with these changes which is why i approved just wanted to make sure before merging. If clippy says we follow clippy. |
Summary
Closes: #351
This pull request includes the following changes:
Details
This pull request addresses a bug identified in #351, where the commitish regex did not enforce the presence of dots between version numbers. The updated regex now requires dots, ensuring that version strings like "1.0.0" are correctly recognized.
This was done by changing the regex pattern from using a
(\.)?to(\.)+, ensuring that at least one dot is present between version segments. Reaming repeats of dots are handled by the appended{_,_}number quantifier.