Skip to content

Commit 2ceacad

Browse files
committed
style: add swift-format for code formatting
1 parent a1602b7 commit 2ceacad

File tree

6 files changed

+262
-4
lines changed

6 files changed

+262
-4
lines changed

.gitignore

Lines changed: 139 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ DerivedData/
2222
*.perspectivev3
2323
!default.perspectivev3
2424

25+
# OS generated files #
26+
######################
27+
.DS_Store
28+
.DS_Store?
29+
._*
30+
.Spotlight-V100
31+
.Trashes
32+
ehthumbs.db
33+
Thumbs.db
34+
2535
## Obj-C/Swift specific
2636
*.hmap
2737

@@ -37,14 +47,14 @@ playground.xcworkspace
3747
# Swift Package Manager
3848
#
3949
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
40-
# Packages/
41-
# Package.pins
42-
# Package.resolved
50+
Packages/
51+
Package.pins
52+
Package.resolved
4353
# *.xcodeproj
4454
#
4555
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
4656
# hence it is not needed unless you have added a package configuration file to your project
47-
# .swiftpm
57+
.swiftpm
4858

4959
.build/
5060

@@ -66,6 +76,12 @@ playground.xcworkspace
6676

6777
Carthage/Build/
6878

79+
# Add Xcode project related files required by Carthage
80+
ValidatableKit.xcodeproj/*
81+
!ValidatableKit.xcodeproj/*.pbxproj
82+
!ValidatableKit.xcodeproj/*.plist
83+
!ValidatableKit.xcodeproj/xcshareddata
84+
6985
# Accio dependency management
7086
Dependencies/
7187
.accio/
@@ -88,3 +104,122 @@ fastlane/test_output
88104
# https://github.com/johnno1962/injectionforxcode
89105

90106
iOSInjectionProject/
107+
108+
# DocC
109+
.netrc
110+
.docc-build
111+
*.doccarchive*
112+
113+
# Built Products
114+
*.xcframework*
115+
*.zip
116+
*.tar*
117+
118+
## Node-Js ignores
119+
# Logs
120+
logs
121+
*.log
122+
npm-debug.log*
123+
yarn-debug.log*
124+
yarn-error.log*
125+
lerna-debug.log*
126+
127+
# Diagnostic reports (https://nodejs.org/api/report.html)
128+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
129+
130+
# Runtime data
131+
pids
132+
*.pid
133+
*.seed
134+
*.pid.lock
135+
136+
# Directory for instrumented libs generated by jscoverage/JSCover
137+
lib-cov
138+
139+
# Coverage directory used by tools like istanbul
140+
coverage
141+
*.lcov
142+
143+
# nyc test coverage
144+
.nyc_output
145+
146+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
147+
.grunt
148+
149+
# Bower dependency directory (https://bower.io/)
150+
bower_components
151+
152+
# node-waf configuration
153+
.lock-wscript
154+
155+
# Compiled binary addons (https://nodejs.org/api/addons.html)
156+
build/Release
157+
158+
# Dependency directories
159+
node_modules/
160+
jspm_packages/
161+
162+
# TypeScript v1 declaration files
163+
typings/
164+
165+
# TypeScript cache
166+
*.tsbuildinfo
167+
168+
# Optional npm cache directory
169+
.npm
170+
171+
# Optional eslint cache
172+
.eslintcache
173+
174+
# Microbundle cache
175+
.rpt2_cache/
176+
.rts2_cache_cjs/
177+
.rts2_cache_es/
178+
.rts2_cache_umd/
179+
180+
# Optional REPL history
181+
.node_repl_history
182+
183+
# Output of 'npm pack'
184+
*.tgz
185+
186+
# Yarn Integrity file
187+
.yarn-integrity
188+
189+
# dotenv environment variables file
190+
.env
191+
.env.test
192+
193+
# parcel-bundler cache (https://parceljs.org/)
194+
.cache
195+
196+
# Next.js build output
197+
.next
198+
199+
# Nuxt.js build / generate output
200+
.nuxt
201+
dist
202+
203+
# Gatsby files
204+
.cache/
205+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
206+
# https://nextjs.org/blog/next-9-1#public-directory-support
207+
# public
208+
209+
# vuepress build output
210+
.vuepress/dist
211+
212+
# Serverless directories
213+
.serverless/
214+
215+
# FuseBox cache
216+
.fusebox/
217+
218+
# DynamoDB Local files
219+
.dynamodb/
220+
221+
# TernJS port file
222+
.tern-port
223+
224+
# NPM package lock
225+
package-lock.json

.swift-format

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": 1,
3+
"lineLength": 80,
4+
"indentation": {
5+
"spaces": 4
6+
},
7+
"maximumBlankLines": 1,
8+
"respectsExistingLineBreaks": true,
9+
"indentConditionalCompilationBlocks": false,
10+
"rules": {
11+
"AllPublicDeclarationsHaveDocumentation": true,
12+
"NeverForceUnwrap": true,
13+
"NeverUseForceTry": true,
14+
"NoAccessLevelOnExtensionDeclaration": false,
15+
"ValidateDocumentationComments": true
16+
}
17+
}

Package.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// swift-tools-version:5.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "ValidatableKit",
7+
platforms: [
8+
.iOS(.v8),
9+
.macOS(.v10_10),
10+
.tvOS(.v9),
11+
.watchOS(.v2),
12+
.macCatalyst(.v13)
13+
],
14+
products: [
15+
.library(name: "ValidatableKit", targets: ["ValidatableKit"]),
16+
],
17+
targets: [
18+
.target(name: "ValidatableKit", dependencies: []),
19+
.testTarget(name: "ValidatableKitTests", dependencies: ["ValidatableKit"]),
20+
],
21+
swiftLanguageVersions: [.v5]
22+
)

[email protected]

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// swift-tools-version: 5.5
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "ValidatableKit",
7+
platforms: [
8+
.iOS(.v8),
9+
.macOS(.v10_10),
10+
.tvOS(.v9),
11+
.watchOS(.v2),
12+
.macCatalyst(.v13)
13+
],
14+
products: [
15+
.library(name: "ValidatableKit", targets: ["ValidatableKit"]),
16+
],
17+
targets: [
18+
.target(name: "ValidatableKit", dependencies: []),
19+
.testTarget(name: "ValidatableKitTests", dependencies: ["ValidatableKit"]),
20+
],
21+
swiftLanguageVersions: [.v5]
22+
)

[email protected]

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// swift-tools-version: 5.6
2+
3+
import PackageDescription
4+
5+
let github = "https://github.com"
6+
let appleGitHub = "\(github)/apple"
7+
8+
let package = Package(
9+
name: "ValidatableKit",
10+
platforms: [
11+
.iOS(.v8),
12+
.macOS(.v10_10),
13+
.tvOS(.v9),
14+
.watchOS(.v2),
15+
.macCatalyst(.v13)
16+
],
17+
products: [
18+
.library(name: "ValidatableKit", targets: ["ValidatableKit"]),
19+
],
20+
dependencies: [
21+
.package(url: "\(appleGitHub)/swift-docc-plugin", from: "1.0.0"),
22+
.package(url: "\(appleGitHub)/swift-format", from: "0.50700.0"),
23+
],
24+
targets: [
25+
.target(name: "ValidatableKit", dependencies: []),
26+
.testTarget(name: "ValidatableKitTests", dependencies: ["ValidatableKit"]),
27+
],
28+
swiftLanguageVersions: [.v5]
29+
)

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "ValidatableKit",
3+
"version": "1.0.0",
4+
"summary": "Composable data validation API in Swift exposing simple DSL for writing validations.",
5+
"description": "Composable data validation API in Swift exposing simple and straightforward DSL for writing validations.",
6+
"homepage": "https://github.com/SwiftyLab/ValidatableKit",
7+
"license": "MIT",
8+
"author": {
9+
"name": "Soumya Ranjan Mahunt",
10+
"email": "[email protected]",
11+
"url": "https://twitter.com/soumya_mahunt"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "https://github.com/SwiftyLab/ValidatableKit.git"
16+
},
17+
"private": true,
18+
"dependencies": {
19+
"swiftylab-ci": "github:SwiftyLab/ci"
20+
},
21+
"scripts": {
22+
"build": "npm exec --package=swiftylab-ci -- build.js",
23+
"xcodebuild": "npm exec --package=swiftylab-ci -- xcodebuild.js",
24+
"test": "npm exec --package=swiftylab-ci -- test.js --parallel",
25+
"archive": "npm exec --package=swiftylab-ci -- archive.js",
26+
"pod-lint": "npm exec --package=swiftylab-ci -- pod-lint.js",
27+
"generate": "npm exec --package=swiftylab-ci -- generate.js",
28+
"format": "npm exec --package=swiftylab-ci -- format.js",
29+
"preview-doc": "npm exec --package=swiftylab-ci -- preview-doc.js ValidatableKit",
30+
"build-doc": "npm exec --package=swiftylab-ci -- build-doc.js ValidatableKit",
31+
"serve-doc": "npm exec --package=swiftylab-ci -- serve-doc.js ValidatableKit"
32+
}
33+
}

0 commit comments

Comments
 (0)