Skip to content

Commit

Permalink
➕➖
Browse files Browse the repository at this point in the history
Co-authored-by: Brandon Williams <[email protected]>
  • Loading branch information
stephencelis and mbrandonw committed Aug 23, 2021
0 parents commit d6c3b5f
Show file tree
Hide file tree
Showing 39 changed files with 5,940 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
macos:
name: MacOS
runs-on: macOS-11.0
strategy:
matrix:
xcode:
- 12.5
steps:
- uses: actions/checkout@v2
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Print Swift version
run: swift --version
- name: Run tests
run: make test-swift

linux:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: make test-linux
29 changes: 29 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Documentation
on:
release:
types:
- published
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Generate Documentation
uses: SwiftDocOrg/swift-doc@master
with:
base-url: /swift-custom-dump/
format: html
inputs: Sources/CustomDump
module-name: CustomDump
output: Documentation
- name: Update Permissions
run: 'sudo chown --recursive $USER Documentation'
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BRANCH: gh-pages
FOLDER: Documentation
25 changes: 25 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Format

on:
push:
branches-ignore:
- '**'

jobs:
swift_format:
name: swift-format
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Tap
run: brew tap pointfreeco/formulae
- name: Install
run: brew install Formulae/[email protected]
- name: Format
run: make format
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Run swift-format
branch: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
46 changes: 46 additions & 0 deletions CustomDump.playground/Contents.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import CustomDump
import Foundation

struct User {
var favoriteNumbers: [Int]
var id: Int
var name: String
}

var user = User(
favoriteNumbers: [42, 1729],
id: 2,
name: "Blob"
)

var users = (1...5).map {
User(
favoriteNumbers: [$0],
id: $0,
name: "Blob \($0)"
)
}

var other = users
other.append(
.init(
favoriteNumbers: [42, 1729],
id: 100,
name: "Blob Sr."
)
)

print(diff(users, other)!)

struct MyError: Error {
var id = 1
var message = "asdf"
}

let error: Error = NSError(
domain: "co.pointfree",
code: 42,
userInfo: [NSLocalizedDescriptionKey: "Something went wrong"]
)
customDump(error)
dump(error)
4 changes: 4 additions & 0 deletions CustomDump.playground/contents.xcplayground
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='macos' buildActiveScheme='true' importAppTypes='true'>
<timeline fileName='timeline.xctimeline'/>
</playground>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Point-Free, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
test-all: test-linux test-swift

test-linux:
docker run \
--rm \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.4 \
bash -c 'make test-swift'

test-swift:
swift test \
--parallel

format:
swift format --in-place --recursive .

.PHONY: format test-all test-linux test-swift
16 changes: 16 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "xctest-dynamic-overlay",
"repositoryURL": "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state": {
"branch": null,
"revision": "b9eeb1a7ea3fd6fea54ce57dee2f5794b667c8df",
"version": "0.2.0"
}
}
]
},
"version": 1
}
30 changes: 30 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// swift-tools-version:5.1

import PackageDescription

let package = Package(
name: "swift-custom-dump",
products: [
.library(
name: "CustomDump",
targets: ["CustomDump"]
)
],
dependencies: [
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "0.2.0")
],
targets: [
.target(
name: "CustomDump",
dependencies: [
.product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay")
]
),
.testTarget(
name: "CustomDumpTests",
dependencies: [
"CustomDump"
]
),
]
)
Loading

0 comments on commit d6c3b5f

Please sign in to comment.