-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Reimplement GitUrl
with nom
#61
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tests aren't passing yet
Parse code is a little neater and high level
Refactoring into separate files
Al the parsing works, but now trying to save the results
The colon for scheme is now in the scheme parser
But the tests are broken
* cargo-rdme for readme * Added serde and url as optional
Re-added support and test for short git scheme
nom
GitUrl
with nom
Merged
tjtelan
pushed a commit
that referenced
this pull request
Sep 13, 2025
## 🤖 New release * `git-url-parse`: 0.4.6 -> 0.5.0 (⚠ API breaking changes) ### ⚠ `git-url-parse` breaking changes ```text --- failure constructible_struct_adds_private_field: struct no longer constructible due to new private field --- Description: A struct constructible with a struct literal has a new non-public field. It can no longer be constructed using a struct literal outside of its crate. ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/constructible_struct_adds_private_field.ron Failed in: field GitUrl.password in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:55 field GitUrl.print_scheme in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:67 field GitUrl.hint in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:70 --- failure enum_missing: pub enum removed or renamed --- Description: A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/enum_missing.ron Failed in: enum git_url_parse::Scheme, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:13 --- failure enum_variant_added: enum variant added on exhaustive enum --- Description: A publicly-visible enum without #[non_exhaustive] has a new variant. ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/enum_variant_added.ron Failed in: variant GitUrlParseError:NomParseError in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:17 variant GitUrlParseError:InvalidPathEmpty in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:21 variant GitUrlParseError:InvalidPortNumber in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:25 variant GitUrlParseError:InvalidPasswordUnsupported in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:29 variant GitUrlParseError:InvalidFilePattern in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:33 variant GitUrlParseError:ProviderUnsupported in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:37 variant GitUrlParseError:ProviderParseFail in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:45 variant GitUrlParseError:UnexpectedError in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/error.rs:49 --- failure enum_variant_missing: pub enum variant removed or renamed --- Description: A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/enum_variant_missing.ron Failed in: variant GitUrlParseError::SshUrlNormalizeFailedNoScheme, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:488 variant GitUrlParseError::SshUrlNormalizeFailedSchemeAdded, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:491 variant GitUrlParseError::SshUrlNormalizeFailedSchemeAddedWithPorts, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:494 variant GitUrlParseError::FileUrlNormalizeFailedNoScheme, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:497 variant GitUrlParseError::FileUrlNormalizeFailedSchemeAdded, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:502 variant GitUrlParseError::UnexpectedFormat, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:505 variant GitUrlParseError::UnexpectedScheme, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:509 variant GitUrlParseError::UnsupportedScheme, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:512 variant GitUrlParseError::UnsupportedUrlHostFormat, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:514 variant GitUrlParseError::UnsupportedSshUrlFormat, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:516 variant GitUrlParseError::EmptyPath, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:518 --- failure feature_missing: package feature removed or renamed --- Description: A feature has been removed from this package's Cargo.toml. This will break downstream crates which enable that feature. ref: https://doc.rust-lang.org/cargo/reference/semver.html#cargo-feature-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/feature_missing.ron Failed in: feature tracing in the package's Cargo.toml --- failure function_missing: pub fn removed or renamed --- Description: A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/function_missing.ron Failed in: function git_url_parse::normalize_url, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:378 --- failure struct_pub_field_missing: pub struct's pub field removed or renamed --- Description: A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely. ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/struct_pub_field_missing.ron Failed in: field host of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:42 field name of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:44 field owner of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:46 field organization of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:48 field fullname of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:50 field scheme of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:52 field user of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:54 field token of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:56 field port of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:58 field path of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:60 field git_suffix of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:62 field scheme_prefix of struct GitUrl, previously in file /tmp/.tmpUDU3ga/git-url-parse/src/lib.rs:64 --- failure struct_pub_field_now_doc_hidden: pub struct field is now #[doc(hidden)] --- Description: A pub field of a pub struct is now marked #[doc(hidden)] and is no longer part of the public API. ref: https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#hidden impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/struct_pub_field_now_doc_hidden.ron Failed in: field GitUrl.host in file /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:46 field GitUrl.scheme in file /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:46 field GitUrl.user in file /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:46 field GitUrl.port in file /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:46 field GitUrl.path in file /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:46 --- failure type_mismatched_generic_lifetimes: type now takes a different number of generic lifetimes --- Description: A type now takes a different number of generic lifetime parameters. Uses of this type that name the previous number of parameters will be broken. impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.43.0/src/lints/type_mismatched_generic_lifetimes.ron Failed in: Struct GitUrl (0 -> 1 lifetime params) in /tmp/.tmpE5Am7b/git-url-parse-rs/src/types/mod.rs:46 ``` <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.5.0](v0.4.6...v0.5.0) - 2025-09-13 ### Added - Reimplement `GitUrl` with `nom` ([#61](#61)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reimplement
GitUrl
and introduceGitProvider
traitSee migration docs for 0.4.x to the new patterns at bottom of README.md
Fixes #6
Fixes #7
Resolves #9
Resolves #10
Closes #19