Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #208 from bignerdranch/zwaldowski/lint-happy
Browse files Browse the repository at this point in the history
Linter gardening
  • Loading branch information
zwaldowski authored Mar 20, 2018
2 parents a4f632d + fd074a1 commit ab80653
Show file tree
Hide file tree
Showing 14 changed files with 169 additions and 88 deletions.
20 changes: 8 additions & 12 deletions .fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ lane :bump_version do |options|
puts version
end

desc "Run CocoaPods linter"
lane :pod_lint do
pod_lib_lint(quick: true)
end

desc "Output documentation using Jazzy into docs/"
lane :build_docs do
jazzy(config: ".jazzy.yml")
Expand All @@ -26,13 +21,9 @@ end

desc "Common actions for quality assurance"
private_lane :audit do
pod_lint
swiftlint(strict: true)
pod_lib_lint(quick: true)
build_docs

# Note: Coupling to Travis here is not great!
if is_ci && ENV['TRAVIS_PULL_REQUEST'] == "false" && git_branch == "master"
publish_docs
end
end

platform :mac do
Expand All @@ -43,8 +34,13 @@ platform :mac do

desc "Execute tests, perform CocoaPods linting, publish documentation"
lane :ci do
test
audit
test

# Note: Coupling to Travis here is not great!
if is_ci && ENV['TRAVIS_PULL_REQUEST'] == "false" && git_branch == "master"
publish_docs
end
end
end

Expand Down
2 changes: 0 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ opt_in_rules:
- empty_count
- vertical_whitespace
line_length: 220
type_name:
excluded: My
19 changes: 7 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ language: objective-c
os: osx
osx_image: xcode9
rvm:
- 2.3.1
- 2.4.2
install:
- bundle install --quiet
env:
matrix:
- JOB=macOS
matrix:
include:
- script: bundle exec fastlane ios ci
env: JOB=iOS
- env: JOB=macOS
script: bundle exec fastlane mac ci
- env: JOB=iOS
script: bundle exec fastlane ios ci
after_failure:
- cat ~/Library/Developer/Xcode/DerivedData/Deferred-*/Logs/Test/*/Session-MobileDeferredTests-*.log | true
- cat ~/Library/Logs/scan/Deferred-*.log | true
Expand All @@ -20,11 +19,7 @@ matrix:
dist: trusty
sudo: required
env: JOB=Linux
install:
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
script:
- swift test
script:
- bundle exec fastlane mac ci
install: eval "$(curl -sL https://swiftenv.fuller.li/install.sh)"
script: swift test
notifications:
email: false
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>
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source "https://rubygems.org"

gem 'fastlane'
gem 'semantic'
gem 'cocoapods'
gem 'jazzy'
98 changes: 91 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,61 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.6)
activesupport (4.2.10)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
atomos (0.1.2)
babosa (1.0.2)
claide (1.0.2)
cocoapods (1.4.0)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.4.0)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.1.3, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.6.4)
nap (~> 1.0)
ruby-macho (~> 1.1)
xcodeproj (>= 1.5.4, < 2.0)
cocoapods-core (1.4.0)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.2)
cocoapods-downloader (1.1.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.3.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.5)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
concurrent-ruby (1.0.5)
declarative (0.0.10)
declarative-option (0.1.0)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.2.1)
excon (0.60.0)
escape (0.0.4)
excon (0.61.0)
faraday (0.14.0)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
Expand All @@ -25,20 +65,20 @@ GEM
faraday_middleware (0.12.2)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.1)
fastlane (2.80.0)
fastlane (2.86.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
bundler (>= 1.12.0, < 2.0.0)
colored
commander-fastlane (>= 4.4.5, < 5.0.0)
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.0.1, < 2.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.13.1, < 0.14.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
Expand All @@ -50,6 +90,7 @@ GEM
public_suffix (~> 2.0.0)
rubyzip (>= 1.1.0, < 2.0.0)
security (= 0.1.3)
simctl (~> 1.6)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
Expand All @@ -59,7 +100,10 @@ GEM
xcodeproj (>= 1.5.2, < 2.0.0)
xcpretty (>= 0.2.4, < 1.0.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.1)
ffi (1.9.23)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-api-client (0.13.6)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.5)
Expand All @@ -79,8 +123,20 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jazzy (0.9.1)
cocoapods (~> 1.0)
mustache (~> 0.99)
open4
redcarpet (~> 3.2)
rouge (>= 2.0.6, < 4.0)
sass (~> 3.4)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.1.0)
jwt (2.1.0)
liferaft (0.0.6)
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
Expand All @@ -90,41 +146,67 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
minitest (5.11.3)
molinillo (0.6.4)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
mustache (0.99.8)
nanaimo (0.2.3)
nap (1.1.0)
naturally (2.1.0)
netrc (0.11.0)
open4 (1.3.4)
os (0.9.6)
plist (3.4.0)
public_suffix (2.0.5)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
representable (3.0.4)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (3.1.1)
rouge (2.0.7)
ruby-macho (1.1.0)
rubyzip (1.2.1)
sass (3.5.5)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
security (0.1.3)
semantic (1.6.0)
semantic (1.6.1)
signet (0.8.1)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.2)
CFPropertyList
naturally
slack-notifier (2.3.2)
sqlite3 (1.3.13)
terminal-notifier (1.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
tty-cursor (0.5.0)
tty-screen (0.6.4)
tty-spinner (0.8.0)
tty-cursor (>= 0.5.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.3.0)
word_wrap (1.0.0)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.5.6)
CFPropertyList (~> 2.3.3)
atomos (~> 0.1.2)
Expand All @@ -140,7 +222,9 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods
fastlane
jazzy
semantic

BUNDLED WITH
Expand Down
4 changes: 1 addition & 3 deletions Sources/Deferred/Deferred.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ public final class Deferred<Value>: FutureProtocol, PromiseProtocol {

private final class DeferredStorage<Value>: ManagedBuffer<Void, AnyObject?> {

private typealias My = DeferredStorage<Value>

static func create() -> DeferredStorage<Value> {
return unsafeDowncast(super.create(minimumCapacity: 1, makingHeaderWith: { _ in }), to: My.self)
return unsafeDowncast(super.create(minimumCapacity: 1, makingHeaderWith: { _ in }), to: DeferredStorage<Value>.self)
}

func withAtomicPointerToElement<Return>(_ body: (UnsafeMutablePointer<UnsafeAtomicRawPointer>) throws -> Return) rethrows -> Return {
Expand Down
8 changes: 4 additions & 4 deletions Sources/Task/TaskResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ extension Task.Result: Either {
/// in the style of Cocoa completion handlers.
public init(value: SuccessValue?, error: Error?) {
switch (value, error) {
case (let v?, _):
case (let value?, _):
// Ignore error if value is non-nil
self = .success(v)
case (nil, let e?):
self = .failure(e)
self = .success(value)
case (nil, let error?):
self = .failure(error)
case (nil, nil):
self = .failure(TaskResultInitializerError.invalidInput)
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/AllTestsCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ extension Collection {
#else // arc4random_uniform is also available on BSD and Bionic
let offset = arc4random_uniform(numericCast(count))
#endif
let i = index(startIndex, offsetBy: numericCast(offset))
return self[i]
let index = self.index(startIndex, offsetBy: numericCast(offset))
return self[index]
}

}
Loading

0 comments on commit ab80653

Please sign in to comment.