Skip to content

Commit

Permalink
Fix danger reported warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dogo committed Sep 6, 2021
1 parent 1185b36 commit 8c2726c
Show file tree
Hide file tree
Showing 8 changed files with 391 additions and 354 deletions.
4 changes: 0 additions & 4 deletions Bootstrap/Bootstrap.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@
5EFDC76F1F8699AA001453EC /* DynamicTypeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicTypeTests.swift; sourceTree = "<group>"; };
5EFDC7761F8699F9001453EC /* BootstrapCustomFolderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BootstrapCustomFolderTests.swift; sourceTree = "<group>"; };
65902858E3A876C766DEE813 /* Pods-Bootstrap-BootstrapTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bootstrap-BootstrapTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Bootstrap-BootstrapTests/Pods-Bootstrap-BootstrapTests.release.xcconfig"; sourceTree = "<group>"; };
A3B52C622E22BF8DD5DB225F /* Pods-BootstrapTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BootstrapTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-BootstrapTests/Pods-BootstrapTests.release.xcconfig"; sourceTree = "<group>"; };
C973AE4C6F6F24ACE0BAF412 /* Pods-Bootstrap-BootstrapTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bootstrap-BootstrapTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Bootstrap-BootstrapTests/Pods-Bootstrap-BootstrapTests.debug.xcconfig"; sourceTree = "<group>"; };
CF2E7C50C1B84B73173ED6F7 /* Pods_Bootstrap_BootstrapTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Bootstrap_BootstrapTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CF6BEDA968312D264332A856 /* Pods-Bootstrap.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bootstrap.release.xcconfig"; path = "Pods/Target Support Files/Pods-Bootstrap/Pods-Bootstrap.release.xcconfig"; sourceTree = "<group>"; };
DF74FF8B3AD029F099535426 /* Pods-BootstrapTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BootstrapTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BootstrapTests/Pods-BootstrapTests.debug.xcconfig"; sourceTree = "<group>"; };
EC0A90E60E7AFC30BF41766C /* Pods-Bootstrap.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Bootstrap.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Bootstrap/Pods-Bootstrap.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -135,8 +133,6 @@
C8BD3DA99C7599D57DBEC91F /* Pods */ = {
isa = PBXGroup;
children = (
DF74FF8B3AD029F099535426 /* Pods-BootstrapTests.debug.xcconfig */,
A3B52C622E22BF8DD5DB225F /* Pods-BootstrapTests.release.xcconfig */,
EC0A90E60E7AFC30BF41766C /* Pods-Bootstrap.debug.xcconfig */,
CF6BEDA968312D264332A856 /* Pods-Bootstrap.release.xcconfig */,
C973AE4C6F6F24ACE0BAF412 /* Pods-Bootstrap-BootstrapTests.debug.xcconfig */,
Expand Down
672 changes: 334 additions & 338 deletions Bootstrap/Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

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

17 changes: 11 additions & 6 deletions Nimble_Snapshots/DynamicType/NBSMockedApplication.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ public class NBSMockedApplication {
deinit {
stopMockingPreferredContentSizeCategory()
}

/* On iOS 9, +[UIFont preferredFontForTextStyle:] uses -[UIApplication preferredContentSizeCategory]
// swiftlint:disable line_length
/* On iOS 9, UIFont.preferredFont(forTextStyle:) uses UIApplication.shared.preferredContentSizeCategory
to get the content size category. However, this changed on iOS 10. While I haven't found what UIFont uses to get
the current category, swizzling preferredFontForTextStyle: to use +[UIFont preferredFontForTextStyle: compatibleWithTraitCollection:]
the current category, swizzling preferredFontForTextStyle: to use UIFont.preferredFont(forTextStyle:compatibleWith:)
(only available on iOS >= 10), passing an UITraitCollection with the desired contentSizeCategory.
*/
// swiftlint:enable line_length
public func mockPreferredContentSizeCategory(_ category: UIContentSizeCategory) {

UIApplication.shared.nbs_preferredContentSizeCategory = category
Expand Down Expand Up @@ -72,16 +73,20 @@ extension UIFont {

extension UIApplication {

struct AssociatedKeys {
enum AssociatedKeys {
static var contentSizeCategory: UInt8 = 0
}

@objc var nbs_preferredContentSizeCategory: UIContentSizeCategory? {
get {
return objc_getAssociatedObject(self, &AssociatedKeys.contentSizeCategory) as? UIContentSizeCategory
return objc_getAssociatedObject(self,
&AssociatedKeys.contentSizeCategory) as? UIContentSizeCategory
}
set {
objc_setAssociatedObject(self, &AssociatedKeys.contentSizeCategory, newValue, .OBJC_ASSOCIATION_COPY_NONATOMIC)
objc_setAssociatedObject(self,
&AssociatedKeys.contentSizeCategory,
newValue,
.OBJC_ASSOCIATION_COPY_NONATOMIC)
}
}

Expand Down
3 changes: 2 additions & 1 deletion Nimble_Snapshots/HaveValidSnapshot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ private func performSnapshotTest(_ name: String?,
usesDrawRect: usesDrawRect, snapshot: snapshotName, record: false,
referenceDirectory: referenceImageDirectory, tolerance: tolerance,
perPixelTolerance: pixelTolerance,
filename: filename, identifier: identifier, shouldIgnoreScale: shouldIgnoreScale)
filename: filename, identifier: identifier,
shouldIgnoreScale: shouldIgnoreScale)

return PredicateResult(status: PredicateStatus(bool: result),
message: .fail("expected a matching snapshot in \(snapshotName)"))
Expand Down
4 changes: 0 additions & 4 deletions Nimble_Snapshots/Nimble_Snapshots.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ FOUNDATION_EXPORT double Nimble_SnapshotsVersionNumber;
FOUNDATION_EXPORT const unsigned char Nimble_SnapshotsVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <Nimble_Snapshots/PublicHeader.h>

#if __has_include("NBSMockedApplication.h")
#import "NBSMockedApplication.h"
#endif
43 changes: 43 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"object": {
"pins": [
{
"package": "CwlCatchException",
"repositoryURL": "https://github.com/mattgallagher/CwlCatchException.git",
"state": {
"branch": null,
"revision": "682841464136f8c66e04afe5dbd01ab51a3a56f2",
"version": "2.1.0"
}
},
{
"package": "CwlPreconditionTesting",
"repositoryURL": "https://github.com/mattgallagher/CwlPreconditionTesting.git",
"state": {
"branch": null,
"revision": "0630439888c94657a235ffcd5977d6047ef3c87b",
"version": "2.0.1"
}
},
{
"package": "FBSnapshotTestCase",
"repositoryURL": "https://github.com/uber/ios-snapshot-test-case.git",
"state": {
"branch": null,
"revision": "6743a701c996d8aa249e1acfbcb4fa7af4365ea6",
"version": "7.0.0"
}
},
{
"package": "Nimble",
"repositoryURL": "https://github.com/Quick/Nimble.git",
"state": {
"branch": null,
"revision": "c93f16c25af5770f0d3e6af27c9634640946b068",
"version": "9.2.1"
}
}
]
},
"version": 1
}
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import PackageDescription

// swiftlint:disable:next prefixed_toplevel_constant
let package = Package(
name: "Nimble-Snapshots",
platforms: [.iOS(.v10), .tvOS(.v10)],
Expand Down

0 comments on commit 8c2726c

Please sign in to comment.