Skip to content

Commit dcbbd35

Browse files
authored
Merge pull request #1063 from stephencelis/swiftlint
Add linting
2 parents 09d8534 + 6d5bb0c commit dcbbd35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+2208
-2048
lines changed

.cocoadocs.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ jobs:
1414
gem install xcpretty --no-document
1515
brew update
1616
brew outdated carthage || brew upgrade carthage
17+
brew outdated swiftlint || brew upgrade swiftlint
18+
- name: "Lint"
19+
run: make lint
20+
- name: "Run tests (PACKAGE_MANAGER_COMMAND: test)"
21+
env:
22+
PACKAGE_MANAGER_COMMAND: test -Xswiftc -warnings-as-errors
23+
run: ./run-tests.sh
1724
- name: "Run tests (BUILD_SCHEME: SQLite iOS)"
1825
env:
1926
BUILD_SCHEME: SQLite iOS
@@ -54,7 +61,3 @@ jobs:
5461
env:
5562
CARTHAGE_PLATFORM: tvOS
5663
run: ./run-tests.sh
57-
- name: "Run tests (PACKAGE_MANAGER_COMMAND: test)"
58-
env:
59-
PACKAGE_MANAGER_COMMAND: test
60-
run: ./run-tests.sh

.swiftlint.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
disabled_rules: # rule identifiers to exclude from running
2+
- todo
3+
- operator_whitespace
4+
- large_tuple
5+
- closure_parameter_position
6+
included: # paths to include during linting. `--path` is ignored if present. takes precendence over `excluded`.
7+
- Sources
8+
- Tests
9+
excluded: # paths to ignore during linting. overridden by `included`.
10+
11+
identifier_name:
12+
excluded:
13+
- db
14+
- in
15+
- to
16+
- by
17+
- or
18+
- eq
19+
- gt
20+
- lt
21+
- fn
22+
- a
23+
- b
24+
- q
25+
- SQLITE_TRANSIENT
26+
27+
type_body_length:
28+
warning: 260
29+
error: 260
30+
31+
function_body_length:
32+
warning: 60
33+
error: 60
34+
35+
line_length:
36+
warning: 150
37+
error: 150
38+
ignores_comments: true
39+
40+
file_length:
41+
warning: 900
42+
error: 900

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ addresses everything. If it doesn’t, continue the conversation there.
1919
If your searches return empty, see the [bug](#bugs) or [feature
2020
request](#feature-requests) guidelines below.
2121

22-
[Ask on Stack Overflow]: http://stackoverflow.com/questions/tagged/sqlite.swift
22+
[Ask on Stack Overflow]: https://stackoverflow.com/questions/tagged/sqlite.swift
2323
[Search]: https://github.com/stephencelis/SQLite.swift/search?type=Issues
2424

2525

Documentation/Release.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SQLite.swift Release checklist
2+
3+
* [ ] Make sure current master branch has a green build
4+
* [ ] Make sure `CHANGELOG.md` is up-to-date
5+
* [ ] Update the version number in `SQLite.swift.podspec`
6+
* [ ] Run `pod lib lint` locally
7+
* [ ] Update the version numbers mentioned in `README.md`, `Documentation/Index.md`
8+
* [ ] Update `MARKETING_VERSION` in `SQLite.xcodeproj/project.pbxproj`
9+
* [ ] Create a tag with the version number (`x.y.z`)
10+
* [ ] Publish to CocoaPods: `pod trunk push`
11+
* [ ] Update the release information on GitHub

Makefile

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,31 @@ else
99
endif
1010

1111
XCPRETTY := $(shell command -v xcpretty)
12-
SWIFTCOV := $(shell command -v swiftcov)
13-
GCOVR := $(shell command -v gcovr)
1412
TEST_ACTIONS := clean build build-for-testing test-without-building
1513

1614
default: test
1715

1816
build:
1917
$(BUILD_TOOL) $(BUILD_ARGUMENTS)
2018

19+
lint:
20+
swiftlint --strict
21+
2122
test:
2223
ifdef XCPRETTY
2324
@set -o pipefail && $(BUILD_TOOL) $(BUILD_ARGUMENTS) $(TEST_ACTIONS) | $(XCPRETTY) -c
2425
else
2526
$(BUILD_TOOL) $(BUILD_ARGUMENTS) $(TEST_ACTIONS)
2627
endif
2728

28-
coverage:
29-
ifdef SWIFTCOV
30-
$(SWIFTCOV) generate --output coverage \
31-
$(BUILD_TOOL) $(BUILD_ARGUMENTS) -configuration Release test \
32-
-- ./SQLite/*.swift
33-
ifdef GCOVR
34-
$(GCOVR) \
35-
--root . \
36-
--use-gcov-files \
37-
--html \
38-
--html-details \
39-
--output coverage/index.html \
40-
--keep
41-
else
42-
@echo gcovr must be installed for HTML output: https://github.com/gcovr/gcovr
43-
endif
44-
else
45-
@echo swiftcov must be installed for coverage: https://github.com/realm/SwiftCov
46-
@exit 1
47-
endif
48-
4929
clean:
5030
$(BUILD_TOOL) $(BUILD_ARGUMENTS) clean
51-
rm -r coverage
5231

5332
repl:
5433
@$(BUILD_TOOL) $(BUILD_ARGUMENTS) -derivedDataPath $(TMPDIR)/SQLite.swift > /dev/null && \
5534
swift -F '$(TMPDIR)/SQLite.swift/Build/Products/Debug'
5635

5736
sloc:
58-
@zsh -c "grep -vE '^ *//|^$$' SQLite/*/*.{swift,h,m} | wc -l"
37+
@zsh -c "grep -vE '^ *//|^$$' Sources/**/*.{swift,h,m} | wc -l"
5938

60-
.PHONY: test coverage clean repl sloc
39+
.PHONY: test clean repl sloc

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ syntax _and_ intent.
2020
- Extensively tested
2121
- [SQLCipher][] support via CocoaPods
2222
- Active support at
23-
[StackOverflow](http://stackoverflow.com/questions/tagged/sqlite.swift),
23+
[StackOverflow](https://stackoverflow.com/questions/tagged/sqlite.swift),
2424
and [Gitter Chat Room](https://gitter.im/stephencelis/SQLite.swift)
2525
(_experimental_)
2626

@@ -119,7 +119,7 @@ For a more comprehensive example, see
119119
and the [companion repository][SQLiteDataAccessLayer2].
120120

121121

122-
[Create a Data Access Layer with SQLite.swift and Swift 2]: http://masteringswift.blogspot.com/2015/09/create-data-access-layer-with.html
122+
[Create a Data Access Layer with SQLite.swift and Swift 2]: https://masteringswift.blogspot.com/2015/09/create-data-access-layer-with.html
123123
[SQLiteDataAccessLayer2]: https://github.com/hoffmanjon/SQLiteDataAccessLayer2/tree/master
124124

125125
## Installation
@@ -226,7 +226,7 @@ device:
226226

227227

228228
[Xcode]: https://developer.apple.com/xcode/downloads/
229-
[Submodule]: http://git-scm.com/book/en/Git-Tools-Submodules
229+
[Submodule]: https://git-scm.com/book/en/Git-Tools-Submodules
230230
[download]: https://github.com/stephencelis/SQLite.swift/archive/master.zip
231231

232232

@@ -243,7 +243,7 @@ device:
243243

244244
[See the planning document]: /Documentation/Planning.md
245245
[Read the contributing guidelines]: ./CONTRIBUTING.md#contributing
246-
[Ask on Stack Overflow]: http://stackoverflow.com/questions/tagged/sqlite.swift
246+
[Ask on Stack Overflow]: https://stackoverflow.com/questions/tagged/sqlite.swift
247247
[Open an issue]: https://github.com/stephencelis/SQLite.swift/issues/new
248248
[Submit a pull request]: https://github.com/stephencelis/SQLite.swift/fork
249249

@@ -280,16 +280,16 @@ Looking for something else? Try another Swift wrapper (or [FMDB][]):
280280
- [SwiftSQLite](https://github.com/chrismsimpson/SwiftSQLite)
281281

282282
[Swift]: https://swift.org/
283-
[SQLite3]: http://www.sqlite.org
283+
[SQLite3]: https://www.sqlite.org
284284
[SQLite.swift]: https://github.com/stephencelis/SQLite.swift
285285

286286
[GitHubActionBadge]: https://img.shields.io/github/workflow/status/stephencelis/SQLite.swift/Build%20and%20test
287287

288288
[CocoaPodsVersionBadge]: https://cocoapod-badges.herokuapp.com/v/SQLite.swift/badge.png
289-
[CocoaPodsVersionLink]: http://cocoadocs.org/docsets/SQLite.swift
289+
[CocoaPodsVersionLink]: https://cocoapods.org/pods/SQLite.swift
290290

291291
[PlatformBadge]: https://cocoapod-badges.herokuapp.com/p/SQLite.swift/badge.png
292-
[PlatformLink]: http://cocoadocs.org/docsets/SQLite.swift
292+
[PlatformLink]: https://cocoapods.org/pods/SQLite.swift
293293

294294
[CartagheBadge]: https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat
295295
[CarthageLink]: https://github.com/Carthage/Carthage

SQLite.swift.podspec

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "SQLite.swift"
33
s.version = "0.13.0"
4-
s.summary = "A type-safe, Swift-language layer over SQLite3 for iOS and macOS."
4+
s.summary = "A type-safe, Swift-language layer over SQLite3."
55

66
s.description = <<-DESC
77
SQLite.swift provides compile-time confidence in SQL statement syntax and
@@ -17,13 +17,12 @@ Pod::Spec.new do |s|
1717
s.module_name = 'SQLite'
1818
s.default_subspec = 'standard'
1919
s.swift_versions = ['5']
20-
21-
20+
2221
ios_deployment_target = '9.0'
2322
tvos_deployment_target = '9.1'
2423
osx_deployment_target = '10.15'
2524
watchos_deployment_target = '3.0'
26-
25+
2726
s.ios.deployment_target = ios_deployment_target
2827
s.tvos.deployment_target = tvos_deployment_target
2928
s.osx.deployment_target = osx_deployment_target

0 commit comments

Comments
 (0)