nephila / giturlparse

Parse & rewrite git urls (supports GitHub, Bitbucket, Assembla ...)
https://pypi.python.org/pypi/giturlparse
Apache License 2.0
31 stars 23 forks source link

Fix Gitlab parsing for reponame with "-" #74

Closed boozec closed 1 year ago

boozec commented 1 year ago

Hi all :wave:

Description

Gitlab URLs has the format with "/-/blob/". This PR fixs the parser editing the FORMAT string with the "/-/" before the ('blob'|'tree').

eg: The string "https://gitlab.com/gitlab-org/gitlab/blob/master/README.md" is valid as "https://gitlab.com/gitlab-org/gitlab/-/blob/master/README.md".

References

Fixs https://github.com/nephila/giturlparse/issues/42

Checklist

codecov[bot] commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@f34ffa8). Click here to learn what that means. Patch has no changes to coverable lines.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #74 +/- ## ========================================= Coverage ? 94.22% ========================================= Files ? 12 Lines ? 225 Branches ? 49 ========================================= Hits ? 212 Misses ? 10 Partials ? 3 ``` | [Flag](https://app.codecov.io/gh/nephila/giturlparse/pull/74/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nephila) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/nephila/giturlparse/pull/74/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nephila) | `94.22% <0.00%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=nephila#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

protoroto commented 1 year ago

@boozec Hi! Thanks for the contribution! Two minor things:

boozec commented 1 year ago

Hi @protoroto sorry but the rename deleted this PR :sweat_smile: i'm reopening and added another test without - in both name and before the "/blob" :)

edit: there is a test (the old one) at https://github.com/nephila/giturlparse/pull/74/files#diff-75ab2ceadb20388b5d32a82bda0f5ad26298c06693e55bd3947be19a6d429606R437