{"id":13684502,"url":"https://github.com/taji-taji/DangerSwiftPeriphery","last_synced_at":"2025-04-30T21:30:44.576Z","repository":{"id":42031413,"uuid":"481228923","full_name":"taji-taji/DangerSwiftPeriphery","owner":"taji-taji","description":"Danger Swift plugin to run Periphery on CI.","archived":false,"fork":false,"pushed_at":"2024-05-22T13:59:24.000Z","size":281,"stargazers_count":12,"open_issues_count":4,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T09:58:03.175Z","etag":null,"topics":["danger","danger-plugin","danger-swift","danger-swift-plugin","swift","swift5","swift5-8","swift5-9"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taji-taji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-13T13:32:02.000Z","updated_at":"2025-01-20T08:49:08.000Z","dependencies_parsed_at":"2023-12-13T14:45:03.774Z","dependency_job_id":null,"html_url":"https://github.com/taji-taji/DangerSwiftPeriphery","commit_stats":{"total_commits":111,"total_committers":3,"mean_commits":37.0,"dds":0.09909909909909909,"last_synced_commit":"6439049a8d0be3a218eb0df7207b9c729043f7b4"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taji-taji%2FDangerSwiftPeriphery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taji-taji%2FDangerSwiftPeriphery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taji-taji%2FDangerSwiftPeriphery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taji-taji%2FDangerSwiftPeriphery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taji-taji","download_url":"https://codeload.github.com/taji-taji/DangerSwiftPeriphery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251785352,"owners_count":21643462,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["danger","danger-plugin","danger-swift","danger-swift-plugin","swift","swift5","swift5-8","swift5-9"],"created_at":"2024-08-02T14:00:34.239Z","updated_at":"2025-04-30T21:30:44.136Z","avatar_url":"https://github.com/taji-taji.png","language":"Swift","funding_links":[],"categories":["Plugins"],"sub_categories":["Swift (danger-swift)"],"readme":"# DangerSwiftPeriphery\n\n[Danger Swift](https://github.com/danger/swift) plugin to run [Periphery](https://github.com/peripheryapp/periphery) on CI.\n\n\n![Test](https://github.com/taji-taji/DangerSwiftPeriphery/actions/workflows/test.yml/badge.svg)\n[![MIT License](https://img.shields.io/github/license/taji-taji/DangerSwiftPeriphery)](https://github.com/taji-taji/DangerSwiftPeriphery/blob/main/LICENSE)\n[![Latest Version](https://img.shields.io/github/v/release/taji-taji/DangerSwiftPeriphery?label=latest%20version)](https://github.com/taji-taji/DangerSwiftPeriphery/releases/latest)\n[![Swift Compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftaji-taji%2FDangerSwiftPeriphery%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/taji-taji/DangerSwiftPeriphery)\n[![Platform Compatibility](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftaji-taji%2FDangerSwiftPeriphery%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/taji-taji/DangerSwiftPeriphery)\n\n## Features\n\nThis plugin will comment unreferenced code detected by periphery via Danger Swift.\n\n![Image](Resources/Images/screenshot.png)\n\n## Requirements\n\n- Swift 5.8 or later\n\n## Usage\n\n### Preparation\n\n- [Danger Swift](https://github.com/danger/swift) Setup.\n\n### Package.swift\n\n1. Add DangerSwiftPeriphery to your `Package.swift`  dependencies:\n\n    ```swift\n    .package(url: \"https://github.com/taji-taji/DangerSwiftPeriphery.git\", from: \"1.0.0\")\n    ```\n\n2. Add DangerSwiftPeriphery to your dependencies of `DangerDependencies` target:\n\n    ```swift\n    .product(name: \"DangerSwiftPeriphery\", package: \"DangerSwiftPeriphery\")\n    ```\n\nThe following is an example of `Package.swift` in its entirety.\n\n```swift\nlet package = Package(\n    // ...\n    dependencies: [\n        // Danger\n        .package(url: \"https://github.com/danger/swift.git\", from: \"3.0.0\"), // dev\n        // Danger Plugins\n        // 1. Add DangerSwiftPeriphery to your `Package.swift`  dependencies:\n        .package(url: \"https://github.com/taji-taji/DangerSwiftPeriphery.git\", from: \"1.0.0\"), // dev\n    ],\n    targets: [\n        // ...\n        // Add DangerSwiftPeriphery to dependencies in DangerDependencies.\n        .target(name: \"DangerDependencies\",\n                dependencies: [\n                    .product(name: \"Danger\", package: \"swift\"),\n                    // 2. Add DangerSwiftPeriphery to your dependencies of `DangerDependencies` target:\n                    .product(name: \"DangerSwiftPeriphery\", package: \"DangerSwiftPeriphery\"), \n                ]),\n        // ...\n    ]\n)\n```\n\n\n### Dangerfile.swift\n\n#### Set scan options\n\nIf you have a `.periphery.yml` file, simply include the following in `Dangerfile.swift`\n\n```swift\nimport Danger\nimport DangerSwiftPeriphery\n\nDangerPeriphery.scan()\n```\n\nAlternatively, periphery options can be passed as arguments.\n\n```swift\nimport Danger\nimport DangerSwiftPeriphery\n\nDangerPeriphery.scan(arguments: [\n    \"--workspace MaApp.xcworkspace\",\n    \"--schemes MyApp\",\n    \"--index-store-path /path/to/index/store\",\n    \"--skip-build\"\n])\n\n// or use PeripheryScanOptions enum as array\nDangerPeriphery.scan(arguments: [\n    PeripheryScanOptions.workspace(\"MaApp.xcworkspace\"),\n    PeripheryScanOptions.schemes([\"MyApp\"]),\n    PeripheryScanOptions.indexStorePath(\"/path/to/index/store\"),\n    PeripheryScanOptions.skipBuild\n])\n\n// or use PeripheryScanOptions enum with resultBuilder\nDangerPeriphery.scan {\n    PeripheryScanOptions.workspace(\"MaApp.xcworkspace\")\n    PeripheryScanOptions.schemes([\"MyApp\"])\n    PeripheryScanOptions.indexStorePath(\"/path/to/index/store\")\n    PeripheryScanOptions.skipBuild\n}\n\n// All three scan methods above behave the same.\n```\n\nIn the future, if a new option is added to Periphery, and it is undefined in this plugin, you can use `.custom`.\nFor example, if a new version of Periphery adds an option `--new-option` that is undefined in `PeripheryScanOptions` of this plugin, you can use `PeripheryScanOptions.custom(\"--new-option foo\")` to use `--new-option`.\n\n#### Handle scan result manually\n\nBy setting the `shouldComment` option to false, this plugin will not comment on the target pull request.  \nYou can manually handle the scan results by setting this option to false and using the return value of the scan method.\n\n```swift\nimport Danger\nimport DangerSwiftPeriphery\n\nlet result = DangerPeriphery.scan(shouldComment: false)\n\n// handle scan result manually\nswitch result {\ncase let .success(violations):\n    // handle scan violations\n    for violation in violations {\n        warn(message: violation.message,\n             file: violation.filePath,\n             line: violation.line)\n    }\ncase let .failure(error):\n    // handle scan error\n    fail(error.localizedDescription)\n}\n```\n\n#### Specify periphery executable\n\nYou may also specify the location of periphery binaries.\n\n```swift\nimport DangerSwiftPeriphery\n\nDangerPeriphery.scan(peripheryExecutable: \"/path/to/periphery\")\n```\n\n### Debug print\n\nThe option for Debug can be used to output debugging information.\nThis can be done in one of the following ways.\n\n1. `verbose` argument\n    - Set the `verbose` argument of the scan method to true. (Default: false)\n    ```swift\n    // in Dangerfile.swift\n    DangerPeriphery.scan(verbose: true)\n    ```\n\n2. `DANGER_SWIFT_PERIPHERY_DEBUG` environment variables\n    - Set `DANGER_SWIFT_PERIPHERY_DEBUG=1` in the environment where danger-swift is run.\nThis environment variable overrides the value of the `verbose` argument described above.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaji-taji%2FDangerSwiftPeriphery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaji-taji%2FDangerSwiftPeriphery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaji-taji%2FDangerSwiftPeriphery/lists"}