Skip to content

Commit

Permalink
Add back private_over_fileprivate for SwiftLint (#67)
Browse files Browse the repository at this point in the history
General cleanups before 0.3 release and an attempt to make Jazzy run on CI (failed so far)

* Cleanup SwiftLint warnings, add docs.sh with jazzy
* Fix conditional checks in docs.sh
* Refine docs.sh
* Install jazzy from gem, not brew in docs.sh
* Run jazzy from gem install path in docs.sh
* Can't easily run Jazzy on Travis :(
* Another attempt to make Jazzy work on Travis
  • Loading branch information
MaxDesiatov authored Jan 20, 2019
1 parent 401de6a commit b8b1ed7
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 13 deletions.
1 change: 0 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
disabled_rules:
- trailing_comma
- identifier_name
- private_over_fileprivate
- void_return
- operator_whitespace
- function_parameter_count
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ script:
# coverage reports in Swift 5.0, see this issue for more details:
# https://github.com/apple/swift-package-manager/pull/1787
- swift test
# this is commented because installing Jazzy on Travis doesn't work ¯\_(ツ)_/¯
# - ./docs.sh
before_deploy:
- brew outdated carthage || brew upgrade carthage
- carthage build --no-skip-current
Expand Down
12 changes: 6 additions & 6 deletions Tests/XMLCoderTests/NodeEncodingStrategyTests.swift
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import XCTest
@testable import XMLCoder

fileprivate struct SingleContainer: Encodable {
private struct SingleContainer: Encodable {
let element: Element

enum CodingKeys: String, CodingKey {
case element
}
}

fileprivate struct KeyedContainer: Encodable {
private struct KeyedContainer: Encodable {
let elements: [String: Element]

enum CodingKeys: String, CodingKey {
case elements = "element"
}
}

fileprivate struct UnkeyedContainer: Encodable {
private struct UnkeyedContainer: Encodable {
let elements: [Element]

enum CodingKeys: String, CodingKey {
case elements = "element"
}
}

fileprivate struct Element: Encodable {
private struct Element: Encodable {
let key: String = "value"
let intKey: Int = 42
let int8Key: Int8 = 42
Expand All @@ -43,15 +43,15 @@ fileprivate struct Element: Encodable {
}
}

fileprivate struct ComplexUnkeyedContainer: Encodable {
private struct ComplexUnkeyedContainer: Encodable {
let elements: [ComplexElement]

enum CodingKeys: String, CodingKey {
case elements = "element"
}
}

fileprivate struct ComplexElement: Encodable {
private struct ComplexElement: Encodable {
struct Key: Encodable {
let a: String
let b: String
Expand Down
20 changes: 14 additions & 6 deletions XMLCoder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@
OBJ_37 /* RJITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RJITest.swift; sourceTree = "<group>"; };
OBJ_38 /* RelationshipsTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RelationshipsTest.swift; sourceTree = "<group>"; };
OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
"XMLCoder::XMLCoder::Product" /* XMLCoder.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XMLCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
"XMLCoder::XMLCoderTests::Product" /* XMLCoderTests.xctest */ = {isa = PBXFileReference; lastKnownFileType = file; path = XMLCoderTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
"XMLCoder::XMLCoder::Product" /* XMLCoder.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = XMLCoder.framework; sourceTree = BUILT_PRODUCTS_DIR; };
"XMLCoder::XMLCoderTests::Product" /* XMLCoderTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = XMLCoderTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -471,6 +471,14 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 9999;
TargetAttributes = {
"XMLCoder::XMLCoder" = {
LastSwiftMigration = 1010;
};
"XMLCoder::XMLCoderTests" = {
LastSwiftMigration = 1010;
};
};
};
buildConfigurationList = OBJ_2 /* Build configuration list for PBXProject "XMLCoder" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -701,7 +709,7 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGET_NAME = XMLCoder;
};
name = Debug;
Expand All @@ -725,7 +733,7 @@
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGET_NAME = XMLCoder;
};
name = Release;
Expand Down Expand Up @@ -776,7 +784,7 @@
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGET_NAME = XMLCoderTests;
};
name = Debug;
Expand All @@ -797,7 +805,7 @@
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGET_NAME = XMLCoderTests;
};
name = Release;
Expand Down
19 changes: 19 additions & 0 deletions docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

echo "TRAVIS_PULL_REQUEST is $TRAVIS_PULL_REQUEST"
echo "TRAVIS_BRANCH is $TRAVIS_BRANCH"
if [[ $TRAVIS_BRANCH == "master" ]]; then
PREFIX="master"
elif [[ ! -z $TRAVIS_TAG ]]; then
PREFIX=$TRAVIS_TAG
else
echo "no tag set or branch isn't 'master', no upload will happen"
exit 0
fi

echo "docs will be uploaded to s3://xmlcoder.org/docs/$PREFIX"

export GEM_HOME=$HOME/.gem

gem install --user-install jazzy && \
~/.gem/ruby/2.4.0/bin/jazzy && aws s3 sync docs s3://xmlcoder.org/docs/$PREFIX

0 comments on commit b8b1ed7

Please sign in to comment.