Skip to content

Commit

Permalink
Merge pull request #4 from k-kohey/feature/swiftlint_and_danger
Browse files Browse the repository at this point in the history
Feature/swiftlint and danger
  • Loading branch information
k-kohey authored Sep 16, 2022
2 parents aeecd8d + c6348f3 commit 38600e6
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/danger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Danger

on: [pull_request]

jobs:
danger:
name: Danger
runs-on: macos-latest

steps:
- name: install danger-swift
run: |
# Install danger-swift
git clone https://github.com/danger/danger-swift.git
cd danger-swift
make install
# Install danger-js
npm install -g danger
- name: Run Danger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: Danger
run: |
swift run danger-swift ci
9 changes: 9 additions & 0 deletions Danger/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
4 changes: 4 additions & 0 deletions Danger/Dangerfile.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Danger

let danger = Danger()
SwiftLint.lint(.modifiedAndCreatedFiles(directory: "Parchment-swift"), inline: true)
122 changes: 122 additions & 0 deletions Danger/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"pins" : [
{
"identity" : "collectionconcurrencykit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git",
"state" : {
"revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95",
"version" : "0.2.0"
}
},
{
"identity" : "logger",
"kind" : "remoteSourceControl",
"location" : "https://github.com/shibapm/Logger",
"state" : {
"revision" : "53c3ecca5abe8cf46697e33901ee774236d94cce",
"version" : "0.2.3"
}
},
{
"identity" : "octokit.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nerdishbynature/octokit.swift",
"state" : {
"revision" : "9521cdff919053868ab13cd08a228f7bc1bde2a9",
"version" : "0.11.0"
}
},
{
"identity" : "requestkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nerdishbynature/RequestKit.git",
"state" : {
"revision" : "fd5e9e99aada7432170366c9e95967011ce13bad",
"version" : "2.4.0"
}
},
{
"identity" : "sourcekitten",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/SourceKitten.git",
"state" : {
"revision" : "b5f9bb749057dd396e93f97956bef64672bc2a04",
"version" : "0.33.0"
}
},
{
"identity" : "swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/danger/swift.git",
"state" : {
"revision" : "0d62144a8bdfdb087c476ac3e88e96491c158a7b",
"version" : "3.14.0"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "9f39744e025c7d377987f30b03770805dcb0bcd1",
"version" : "1.1.4"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "0b6c22b97f8e9320bca62e82cdbee601cf37ad3f",
"version" : "0.50600.1"
}
},
{
"identity" : "swiftlint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/SwiftLint",
"state" : {
"revision" : "57dc1c9532d660ff547dd8ba2176ad82c1175787",
"version" : "0.49.1"
}
},
{
"identity" : "swiftytexttable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/scottrhoyt/SwiftyTextTable.git",
"state" : {
"revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3",
"version" : "0.9.0"
}
},
{
"identity" : "swxmlhash",
"kind" : "remoteSourceControl",
"location" : "https://github.com/drmohundro/SWXMLHash.git",
"state" : {
"revision" : "4d0f62f561458cbe1f732171e625f03195151b60",
"version" : "7.0.1"
}
},
{
"identity" : "version",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mxcl/Version",
"state" : {
"revision" : "1fe824b80d89201652e7eca7c9252269a1d85e25",
"version" : "2.0.1"
}
},
{
"identity" : "yams",
"kind" : "remoteSourceControl",
"location" : "https://github.com/jpsim/Yams.git",
"state" : {
"revision" : "01835dc202670b5bb90d07f3eae41867e9ed29f6",
"version" : "5.0.1"
}
}
],
"version" : 2
}
27 changes: 27 additions & 0 deletions Danger/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Danger",
products: [
.library(
name: "DangerDeps",
type: .dynamic,
targets: ["DangerDependencies"]
),
],
dependencies: [
.package(url: "https://github.com/danger/swift.git", from: "3.14.0"),
.package(url: "https://github.com/realm/SwiftLint", from: "0.49.1")
],
targets: [
.target(
name: "DangerDependencies",
dependencies: [
.product(name: "Danger", package: "swift")
]
)
]
)
8 changes: 8 additions & 0 deletions Danger/Sources/DangerDependencies/File.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// File.swift
//
//
// Created by k-kohey on 2022/09/16.
//

import Foundation

0 comments on commit 38600e6

Please sign in to comment.