Skip to content

Commit c56f6c2

Browse files
committed
Initial commit, project structure
0 parents  commit c56f6c2

26 files changed

+1759
-0
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Expected behavior
2+
_[what you expected to happen]_
3+
4+
### Actual behavior
5+
_[what actually happened]_
6+
7+
### Steps to reproduce
8+
9+
1. ...
10+
2. ...
11+
12+
### If possible, minimal yet complete reproducer code (or URL to code)
13+
14+
_[anything to help us reproducing the issue]_
15+
16+
### SwiftMetrics version/commit hash
17+
18+
_[the SwiftMetrics tag/commit hash]_
19+
20+
### Swift & OS version (output of `swift --version && uname -a`)

.github/PULL_REQUEST_TEMPLATE.md

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

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
.xcode
6+
.SourceKitten
7+
*.orig
8+
.swiftpm
9+
.idea

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Konrad `ktoso` Malawski <[email protected]> <[email protected]>

.swiftformat

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# file options
2+
3+
--swiftversion 5.0
4+
--exclude .build
5+
6+
# format options
7+
8+
--self insert
9+
--patternlet inline
10+
--stripunusedargs unnamed-only
11+
--ifdef no-indent
12+
13+
# rules

CODE_OF_CONDUCT.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Code of Conduct
2+
To be a truly great community, SwiftMetrics needs to welcome developers from all walks of life,
3+
with different backgrounds, and with a wide range of experience. A diverse and friendly
4+
community will have more great ideas, more unique perspectives, and produce more great
5+
code. We will work diligently to make the SwiftMetrics community welcoming to everyone.
6+
7+
To give clarity of what is expected of our members, SwiftMetrics has adopted the code of conduct
8+
defined by [contributor-covenant.org](https://www.contributor-covenant.org). This document is used across many open source
9+
communities, and we think it articulates our values well. The full text is copied below:
10+
11+
### Contributor Code of Conduct v1.3
12+
As contributors and maintainers of this project, and in the interest of fostering an open and
13+
welcoming community, we pledge to respect all people who contribute through reporting
14+
issues, posting feature requests, updating documentation, submitting pull requests or patches,
15+
and other activities.
16+
17+
We are committed to making participation in this project a harassment-free experience for
18+
everyone, regardless of level of experience, gender, gender identity and expression, sexual
19+
orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or
20+
nationality.
21+
22+
Examples of unacceptable behavior by participants include:
23+
- The use of sexualized language or imagery
24+
- Personal attacks
25+
- Trolling or insulting/derogatory comments
26+
- Public or private harassment
27+
- Publishing other’s private information, such as physical or electronic addresses, without explicit permission
28+
- Other unethical or unprofessional conduct
29+
30+
Project maintainers have the right and responsibility to remove, edit, or reject comments,
31+
commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of
32+
Conduct, or to ban temporarily or permanently any contributor for other behaviors that they
33+
deem inappropriate, threatening, offensive, or harmful.
34+
35+
By adopting this Code of Conduct, project maintainers commit themselves to fairly and
36+
consistently applying these principles to every aspect of managing this project. Project
37+
maintainers who do not follow or enforce the Code of Conduct may be permanently removed
38+
from the project team.
39+
40+
This code of conduct applies both within project spaces and in public spaces when an
41+
individual is representing the project or its community.
42+
43+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
44+
contacting a project maintainer at [[email protected]](mailto:[email protected]). All complaints will be reviewed and
45+
investigated and will result in a response that is deemed necessary and appropriate to the
46+
circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter
47+
of an incident.
48+
49+
*This policy is adapted from the Contributor Code of Conduct [version 1.3.0](https://contributor-covenant.org/version/1/3/0/).*
50+
51+
### Reporting
52+
A working group of community members is committed to promptly addressing any [reported issues](mailto:[email protected]).
53+
Working group members are volunteers appointed by the project lead, with a
54+
preference for individuals with varied backgrounds and perspectives. Membership is expected
55+
to change regularly, and may grow or shrink.

CONTRIBUTING.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
* SwiftMetrics commit hash
13+
* Contextual information (e.g. what you were trying to achieve with SwiftMetrics)
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+
SwiftMetrics commit hash: b17a8a9f0f814c01a56977680cb68d8a779c951f
26+
27+
Context:
28+
While testing my application that uses with SwiftMetrics, I noticed that ...
29+
30+
Steps to reproduce:
31+
1. ...
32+
2. ...
33+
3. ...
34+
4. ...
35+
36+
$ swift --version
37+
Swift version 4.0.2 (swift-4.0.2-RELEASE)
38+
Target: x86_64-unknown-linux-gnu
39+
40+
Operating system: Ubuntu Linux 16.04 64-bit
41+
42+
$ uname -a
43+
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
44+
45+
My system has IPv6 disabled.
46+
```
47+
48+
## Writing a Patch
49+
50+
A good SwiftMetrics patch is:
51+
52+
1. Concise, and contains as few changes as needed to achieve the end result.
53+
2. Tested, ensuring that any tests provided failed before the patch and pass after it.
54+
3. Documented, adding API documentation as needed to cover new functions and properties.
55+
4. Accompanied by a great commit message, using our commit message template.
56+
57+
### Commit Message Template
58+
59+
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:
60+
61+
git config commit.template dev/git.commit.template
62+
63+
### Make sure Tests work on Linux
64+
65+
SwiftMetrics uses XCTest to run tests on both macOS and Linux. While the macOS version of XCTest is able to use the Objective-C runtime to discover tests at execution time, the Linux version is not.
66+
For this reason, whenever you add new tests **you have to run a script** that generates the hooks needed to run those tests on Linux, or our CI will complain that the tests are not all present on Linux. To do this, merely execute `ruby ./scripts/generate_linux_tests.rb` at the root of the package and check the changes it made.
67+
68+
### Run `./scripts/sanity.sh`
69+
70+
The scripts directory contains a [sanity.sh script](https://github.com/apple/swift-metrics/blob/main/scripts/sanity.sh)
71+
that enforces additional checks, like license headers and formatting style.
72+
73+
Please make sure to `./scripts/sanity.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
74+
on minor changes such as a missing `self.` or similar formatting issues.
75+
76+
> The script also executes the above mentioned `generate_linux_tests.rb`.
77+
78+
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:
79+
80+
```bash
81+
cat << EOF > .git/hooks/pre-push
82+
#!/bin/bash
83+
84+
if [[ -f "scripts/sanity.sh" ]]; then
85+
scripts/sanity.sh
86+
fi
87+
EOF
88+
```
89+
90+
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
91+
92+
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
93+
94+
## How to contribute your work
95+
96+
Please open a pull request at https://github.com/apple/swift-metrics. Make sure the CI passes, and then wait for code review.

CONTRIBUTORS.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
For the purpose of tracking copyright, this is the list of individuals and
2+
organizations who have contributed source code to the Swift Metrics API.
3+
4+
For employees of an organization/company where the copyright of work done
5+
by employees of that company is held by the company itself, only the company
6+
needs to be listed here.
7+
8+
## COPYRIGHT HOLDERS
9+
10+
- Apple Inc. (all contributors with '@apple.com')
11+
12+
### Contributors
13+
14+
- Cory Benfield <[email protected]>
15+
- Jari (LotU) <[email protected]>
16+
- Konrad `ktoso` Malawski <[email protected]>
17+
- tomer doron <[email protected]>
18+
19+
**Updating this list**
20+
21+
Please do not edit this file manually. It is generated using `./scripts/generate_contributors_list.sh`. If a name is misspelled or appearing multiple times: add an entry in `./.mailmap`

0 commit comments

Comments
 (0)