Skip to content

Commit 05feabe

Browse files
authored
Merge branch 'pointfreeco:main' into main
2 parents f237e56 + dc46eeb commit 05feabe

21 files changed

+126
-45
lines changed

.github/CODE_OF_CONDUCT.md

+107-21
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,131 @@
22

33
## Our Pledge
44

5-
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
614

715
## Our Standards
816

9-
Examples of behavior that contributes to creating a positive environment include:
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
1019

11-
* Using welcoming and inclusive language
12-
* Being respectful of differing viewpoints and experiences
13-
* Gracefully accepting constructive criticism
14-
* Focusing on what is best for the community
15-
* Showing empathy towards other community members
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
1627

17-
Examples of unacceptable behavior by participants include:
28+
Examples of unacceptable behavior include:
1829

19-
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20-
* Trolling, insulting/derogatory comments, and personal or political attacks
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
2133
* Public or private harassment
22-
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23-
* Other conduct which could reasonably be considered inappropriate in a professional setting
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
2438

25-
## Our Responsibilities
39+
## Enforcement Responsibilities
2640

27-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
2845

29-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
3050

3151
## Scope
3252

33-
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
3458

3559
## Enforcement
3660

37-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
3887

39-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
40114

41115
## Attribution
42116

43-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
44127

45-
[homepage]: http://contributor-covenant.org
46-
[version]: http://contributor-covenant.org/version/1/4/
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130+
[Mozilla CoC]: https://github.com/mozilla/diversity
131+
[FAQ]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

Package.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import PackageDescription
44
let package = Package(
55
name: "swift-snapshot-testing",
66
platforms: [
7-
.iOS(.v13),
8-
.macOS(.v10_15),
9-
.tvOS(.v13)
7+
.iOS(.v11),
8+
.macOS(.v10_10),
9+
.tvOS(.v10),
1010
],
1111
products: [
1212
.library(

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 📸 SnapshotTesting
22

33
[![CI](https://github.com/pointfreeco/swift-snapshot-testing/workflows/CI/badge.svg)](https://actions-badge.atrox.dev/pointfreeco/swift-snapshot-testing/goto)
4+
[![Slack](https://img.shields.io/badge/slack-chat-informational.svg?label=Slack&logo=slack)](http://pointfree.co/slack-invite)
45
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpointfreeco%2Fswift-snapshot-testing%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/pointfreeco/swift-snapshot-testing)
56
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fpointfreeco%2Fswift-snapshot-testing%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/pointfreeco/swift-snapshot-testing)
67

@@ -197,6 +198,8 @@ targets: [
197198
- [swift-snapshot-testing-stitch](https://github.com/Sherlouk/swift-snapshot-testing-stitch/) adds the ability to stitch multiple UIView's or UIViewController's together in a single test.
198199

199200
- [SnapshotTestingHEIC](https://github.com/alexey1312/SnapshotTestingHEIC) adds image support using the HEIC storage format which reduces file sizes in comparison to PNG.
201+
202+
- [PreviewSnapshots](https://github.com/doordash-oss/swiftui-preview-snapshots) share `View` configurations between SwiftUI Previews and snapshot tests and generate several snapshots with a single test assertion.
200203

201204
Have you written your own SnapshotTesting plug-in? [Add it here](https://github.com/pointfreeco/swift-snapshot-testing/edit/master/README.md) and submit a pull request!
202205

Sources/SnapshotTesting/Snapshotting/CALayer.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
4+
import QuartzCore
35

46
extension Snapshotting where Value == CALayer, Format == NSImage {
57
/// A snapshot strategy for comparing layers based on pixel equality.

Sources/SnapshotTesting/Snapshotting/CGPath.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
4+
import CoreGraphics
35

46
extension Snapshotting where Value == CGPath, Format == NSImage {
57
/// A snapshot strategy for comparing bezier paths based on pixel equality.

Sources/SnapshotTesting/Snapshotting/NSBezierPath.swift

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
34

45
extension Snapshotting where Value == NSBezierPath, Format == NSImage {
@@ -30,6 +31,7 @@ extension Snapshotting where Value == NSBezierPath, Format == NSImage {
3031

3132
extension Snapshotting where Value == NSBezierPath, Format == String {
3233
/// A snapshot strategy for comparing bezier paths based on pixel equality.
34+
@available(macOS 11.0, *)
3335
@available(iOS 11.0, *)
3436
public static var elementsDescription: Snapshotting {
3537
return .elementsDescription(numberFormatter: defaultNumberFormatter)
@@ -38,6 +40,7 @@ extension Snapshotting where Value == NSBezierPath, Format == String {
3840
/// A snapshot strategy for comparing bezier paths based on pixel equality.
3941
///
4042
/// - Parameter numberFormatter: The number formatter used for formatting points.
43+
@available(macOS 11.0, *)
4144
@available(iOS 11.0, *)
4245
public static func elementsDescription(numberFormatter: NumberFormatter) -> Snapshotting {
4346
let namesByType: [NSBezierPath.ElementType: String] = [

Sources/SnapshotTesting/Snapshotting/NSView.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
34

45
extension Snapshotting where Value == NSView, Format == NSImage {

Sources/SnapshotTesting/Snapshotting/NSViewController.swift

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#if os(macOS)
2+
import AppKit
23
import Cocoa
34

45
extension Snapshotting where Value == NSViewController, Format == NSImage {

Tests/SnapshotTestingTests/SnapshotTestingTests.swift

+1-18
Original file line numberDiff line numberDiff line change
@@ -1127,24 +1127,6 @@ final class SnapshotTestingTests: XCTestCase {
11271127
_ = manipulatingWKWebViewNavigationDelegate
11281128
}
11291129

1130-
#if os(iOS) || os(macOS)
1131-
func testWebViewWithRealUrl() throws {
1132-
let manipulatingWKWebViewNavigationDelegate = ManipulatingWKWebViewNavigationDelegate()
1133-
let webView = WKWebView()
1134-
webView.navigationDelegate = manipulatingWKWebViewNavigationDelegate
1135-
1136-
webView.load(URLRequest(url: URL(string: "https://www.pointfree.co")!))
1137-
if !ProcessInfo.processInfo.environment.keys.contains("GITHUB_WORKFLOW") {
1138-
assertSnapshot(
1139-
matching: webView,
1140-
as: .image(size: .init(width: 800, height: 600)),
1141-
named: platform
1142-
)
1143-
}
1144-
_ = manipulatingWKWebViewNavigationDelegate
1145-
}
1146-
#endif
1147-
11481130
final class CancellingWKWebViewNavigationDelegate: NSObject, WKNavigationDelegate {
11491131
func webView(
11501132
_ webView: WKWebView,
@@ -1154,6 +1136,7 @@ final class SnapshotTestingTests: XCTestCase {
11541136
decisionHandler(.cancel)
11551137
}
11561138
}
1139+
11571140
func testWebViewWithCancellingNavigationDelegate() throws {
11581141
let cancellingWKWebViewNavigationDelegate = CancellingWKWebViewNavigationDelegate()
11591142
let webView = WKWebView()
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ AF ! U ] h=--- v=--- NSButton "Push Me" f=(0,0,83,32) b=(-)
2-
[ A ! U ] h=--- v=--- NSButtonBezelView f=(0,0,83,32) b=(-)
3-
[ AF ! U ] h=--- v=--- NSButtonTextField "Push Me" f=(11,7,61,15) b=(-)
1+
[ AF ! wLU ] h=--- v=--- NSButton "Push Me" f=(0,0,83,32) b=(-) => <_NSViewBackingLayer>
2+
[ A ! wLU ] h=--- v=--- NSButtonBezelView f=(0,0,83,32) b=(-) => <_NSViewBackingLayer>
3+
[ AF ! wLU ] h=--- v=--- NSButtonTextField "Push Me" f=(11,7,61,15) b=(-) => <NSTextLayer>
44
A=autoresizesSubviews, C=canDrawConcurrently, D=needsDisplay, F=flipped, G=gstate, H=hidden (h=by ancestor), L=needsLayout (l=child needsLayout), U=needsUpdateConstraints (u=child needsUpdateConstraints), O=opaque, P=preservesContentDuringLiveResize, S=scaled/rotated, W=wantsLayer (w=ancestor wantsLayer), V=needsVibrancy (v=allowsVibrancy), #=has surface
Loading
Loading
Loading

0 commit comments

Comments
 (0)