Skip to content

Commit

Permalink
feat: add danger-swift (#3406)
Browse files Browse the repository at this point in the history
* feat: add danger-swift

* [autofix.ci] apply automated fixes

* use spm

* typo

* typo

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: jdx <[email protected]>
  • Loading branch information
3 people authored Dec 8, 2024
1 parent ca0cff2 commit a37580e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ You can also specify the full name for a tool using `mise use aqua:1password/cli
| cyclonedx | [aqua:CycloneDX/cyclonedx-cli](https://github.com/CycloneDX/cyclonedx-cli) [asdf:xeedio/asdf-cyclonedx](https://github.com/xeedio/asdf-cyclonedx) |
| dagger | [aqua:dagger/dagger](https://github.com/dagger/dagger) [asdf:virtualstaticvoid/asdf-dagger](https://github.com/virtualstaticvoid/asdf-dagger) |
| danger-js | [asdf:MontakOleg/asdf-danger-js](https://github.com/MontakOleg/asdf-danger-js) |
| danger-swift | [spm:danger/swift](https://github.com/danger/swift) |
| dapr | [aqua:dapr/cli](https://github.com/dapr/cli) [asdf:asdf-community/asdf-dapr-cli](https://github.com/asdf-community/asdf-dapr-cli) |
| dart | [asdf:PatOConnor43/asdf-dart](https://github.com/PatOConnor43/asdf-dart) [vfox:version-fox/vfox-dart](https://github.com/version-fox/vfox-dart) |
| dasel | [aqua:TomWright/dasel](https://github.com/TomWright/dasel) [asdf:asdf-community/asdf-dasel](https://github.com/asdf-community/asdf-dasel) |
Expand Down
1 change: 1 addition & 0 deletions registry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ cyclonedx.backends = ["aqua:CycloneDX/cyclonedx-cli", "asdf:xeedio/asdf-cycloned
cyclonedx.test = ["cyclonedx --version", "{{version}}"]
dagger.backends = ["aqua:dagger/dagger", "asdf:virtualstaticvoid/asdf-dagger"]
danger-js.backends = ["asdf:MontakOleg/asdf-danger-js"]
danger-swift.backends = ["spm:danger/swift"]
dapr.backends = ["aqua:dapr/cli", "asdf:asdf-community/asdf-dapr-cli"]
dapr.test = ["dapr --version", "CLI version: {{version}}"]
dart.backends = ["asdf:PatOConnor43/asdf-dart", "vfox:version-fox/vfox-dart"]
Expand Down
2 changes: 2 additions & 0 deletions scripts/render-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ for (const match of stdout.split("\n")) {
return `[${match[1]}:${match[2]}](https://pypi.org/project/${match[2]})`;
} else if (match[1] === "go") {
return `[${match[1]}:${match[2]}](https://pkg.go.dev/${match[2]})`;
} else if (match[1] === "spm") {
return `[${match[1]}:${match[2]}](https://github.com/${match[2]})`;
} else if (match[1] === "ubi") {
return `[${match[1]}:${match[2]}](https://github.com/${match[2]})`;
} else if (match[1] === "aqua") {
Expand Down
1 change: 1 addition & 0 deletions src/backend/spm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ struct SwiftPackageRepo {
impl SwiftPackageRepo {
/// Parse the slug or the full URL of a GitHub package repository.
fn new(name: &str) -> Result<Self, eyre::Error> {
let name = name.strip_prefix("spm:").unwrap_or(name);
let shorthand_regex = regex!(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9._-]+$");
let shorthand_in_url_regex =
regex!(r"https://github.com/([a-zA-Z0-9_-]+/[a-zA-Z0-9._-]+)\.git");
Expand Down

0 comments on commit a37580e

Please sign in to comment.