Skip to content

Commit 499a317

Browse files
authored
Update CoC and add CONTRIBUTING file (#87)
1 parent 1aff1f1 commit 499a317

File tree

3 files changed

+100
-74
lines changed

3 files changed

+100
-74
lines changed

CODE_OF_CONDUCT.md

+3-74
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,5 @@
1-
# Contributor Covenant Code of Conduct
1+
# Code of Conduct
22

3-
## Our Pledge
3+
The code of conduct for this project can be found at https://swift.org/code-of-conduct.
44

5-
In the interest of fostering an open and welcoming environment, we as
6-
contributors and maintainers pledge to making participation in our project and
7-
our community a harassment-free experience for everyone, regardless of age, body
8-
size, disability, ethnicity, sex characteristics, gender identity and expression,
9-
level of experience, education, socio-economic status, nationality, personal
10-
appearance, race, religion, or sexual identity and orientation.
11-
12-
## Our Standards
13-
14-
Examples of behavior that contributes to creating a positive environment
15-
include:
16-
17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
22-
23-
Examples of unacceptable behavior by participants include:
24-
25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
33-
34-
## Our Responsibilities
35-
36-
Project maintainers are responsible for clarifying the standards of acceptable
37-
behavior and are expected to take appropriate and fair corrective action in
38-
response to any instances of unacceptable behavior.
39-
40-
Project maintainers have the right and responsibility to remove, edit, or
41-
reject comments, commits, code, wiki edits, issues, and other contributions
42-
that are not aligned to this Code of Conduct, or to ban temporarily or
43-
permanently any contributor for other behaviors that they deem inappropriate,
44-
threatening, offensive, or harmful.
45-
46-
## Scope
47-
48-
This Code of Conduct applies both within project spaces and in public spaces
49-
when an individual is representing the project or its community. Examples of
50-
representing a project or community include using an official project e-mail
51-
address, posting via an official social media account, or acting as an appointed
52-
representative at an online or offline event. Representation of a project may be
53-
further defined and clarified by project maintainers.
54-
55-
## Enforcement
56-
57-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting the project team at [email protected]. All
59-
complaints will be reviewed and investigated and will result in a response that
60-
is deemed necessary and appropriate to the circumstances. The project team is
61-
obligated to maintain confidentiality with regard to the reporter of an incident.
62-
Further details of specific enforcement policies may be posted separately.
63-
64-
Project maintainers who do not follow or enforce the Code of Conduct in good
65-
faith may face temporary or permanent repercussions as determined by other
66-
members of the project's leadership.
67-
68-
## Attribution
69-
70-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71-
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72-
73-
[homepage]: https://www.contributor-covenant.org
74-
75-
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
5+
<!-- Copyright (c) 2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->

CONTRIBUTING.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
## Legal
2+
3+
By submitting a pull request, you represent that you have the right to license
4+
your contribution to Apple and the community, and agree by submitting the patch
5+
that your contributions are licensed under the Apache 2.0 license (see
6+
`LICENSE.txt`).
7+
8+
## How to submit a bug report
9+
10+
Please ensure to specify the following:
11+
12+
* Swift Distributed Tracing commit hash
13+
* Contextual information (e.g. what you were trying to achieve with Swift Distributed Tracing)
14+
* Simplest possible steps to reproduce
15+
* More complex the steps are, lower the priority will be.
16+
* A pull request with failing test case is preferred, but it's just fine to paste the test case into the issue description.
17+
* Anything that might be relevant in your opinion, such as:
18+
* Swift version or the output of `swift --version`
19+
* OS version and the output of `uname -a`
20+
* Network configuration
21+
22+
### Example
23+
24+
```
25+
Commit hash: b17a8a9f0f814c01a56977680cb68d8a779c951f
26+
Context:
27+
While testing my application that uses Swift Distributed Tracing, I noticed that ...
28+
Steps to reproduce:
29+
1. ...
30+
2. ...
31+
3. ...
32+
4. ...
33+
$ swift --version
34+
Swift version 4.0.2 (swift-4.0.2-RELEASE)
35+
Target: x86_64-unknown-linux-gnu
36+
Operating system: Ubuntu Linux 16.04 64-bit
37+
$ uname -a
38+
Linux beefy.machine 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
39+
My system has IPv6 disabled.
40+
```
41+
42+
## Writing a Patch
43+
44+
A good patch is:
45+
46+
1. Concise, and contains as few changes as needed to achieve the end result.
47+
2. Tested, ensuring that any tests provided failed before the patch and pass after it.
48+
3. Documented, adding API documentation as needed to cover new functions and properties.
49+
4. Accompanied by a great commit message, using our commit message template.
50+
51+
### Commit Message Template
52+
53+
We require that your commit messages match our template. The easiest way to do that is to get git to help you by explicitly using the template. To do that, `cd` to the root of our repository and run:
54+
55+
git config commit.template dev/git.commit.template
56+
57+
### Run `./scripts/soundness.sh`
58+
59+
The scripts directory contains a [soundness.sh script](https://github.com/apple/swift-distributed-tracing/blob/main/scripts/soundness.sh)
60+
that enforces additional checks, like license headers and formatting style.
61+
62+
Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
63+
on minor changes such as a missing `self.` or similar formatting issues.
64+
65+
> The script also executes the above mentioned `generate_linux_tests.rb`.
66+
For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command in the project root directory:
67+
68+
```bash
69+
cat << EOF > .git/hooks/pre-push
70+
#!/bin/bash
71+
if [[ -f "scripts/soundness.sh" ]]; then
72+
scripts/soundness.sh
73+
fi
74+
EOF
75+
```
76+
77+
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
78+
79+
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
80+
81+
## How to contribute your work
82+
83+
Please open a pull request at https://github.com/apple/swift-distributed-tracing. Make sure the CI passes, and then wait for code review.

dev/git.commit.template

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- One line description of your change -->
2+
3+
**Motivation:**
4+
5+
<!-- Explain here the context, and why you're making that change.
6+
What is the problem you're trying to solve. -->
7+
8+
**Modifications:**
9+
10+
<!-- Describe the modifications you've done. -->
11+
12+
**Result:**
13+
14+
<!-- After your change, what will change. -->

0 commit comments

Comments
 (0)