Skip to content

Conversation

tjtelan
Copy link
Owner

@tjtelan tjtelan commented Sep 13, 2025

Reimplement GitUrl and introduce GitProvider trait

  • 2024 edition
  • MSRV 1.85
  • Doctests
  • More stable dependencies
  • New cargo features

See 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

@tjtelan tjtelan changed the title feat: Rewrite parser with nom feat: Reimplement GitUrl with nom Sep 13, 2025
@tjtelan tjtelan merged commit 2001baa into main Sep 13, 2025
12 checks passed
@tjtelan tjtelan deleted the nom-test branch September 13, 2025 06:55
@github-actions github-actions bot mentioned this pull request Sep 13, 2025
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

Labels

None yet

Projects

None yet

1 participant