scrutinizer-ci / ocular

CLI for uploading external code coverage data
https://scrutinizer-ci.com
41 stars 24 forks source link

Expanded qualified name parser to allow tokenized git urls #27

Closed ashon-ikon closed 7 years ago

ashon-ikon commented 7 years ago

The current parser regex does not accept tokenized git remote URLs. This pull request seeks to expand the pattern.

Previous Scenarios

URL Remark
git@github.com:schmittjoh/metadata.git Worked
https://github.com/schmittjoh/metadata.git Worked
https://schmittjoh:2ae3578bfd30cbc9bb58861cf9f0fa742259cdb8@github.com/schmittjoh/metadata.git Failed

Current Scenarios

URL Remark
git@github.com:schmittjoh/metadata.git Worked
https://github.com/schmittjoh/metadata.git Worked
https://schmittjoh:2ae3578bfd30cbc9bb58861cf9f0fa742259cdb8@github.com/schmittjoh/metadata.git Works

Just by altering the regular expression from

#^[^\s]+\s+(?:git@|(?:git|https?)://)([^:/]+)(?:/|:)([^/]+)/([^/\s]+?)(?:\.git)?(?:\s|\n)#m

to

#^[^\s]+\s+(?:[^\s]+@|(?:git|https?)://)([^:/]+)(?:/|:)([^/]+)/([^/\s]+?)(?:\.git)?(?:\s|\n)#m
ashon-ikon commented 7 years ago

A big thank @schmittjoh for accepting the pull request swiftly.

Please do you mind updating the Phar file as well, soon. Thanks