Skip to content

Commit 7565bba

Browse files
Initial commit
fbshipit-source-id: f24207cd48d2b7eeb92e79eb7d27c417e837147c
0 parents  commit 7565bba

25 files changed

+3029
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Contributing to whatsapp/assert
2+
We want to make contributing to this project as easy and transparent as
3+
possible.
4+
5+
## Our Development Process
6+
7+
## Pull Requests
8+
We actively welcome your pull requests.
9+
10+
1. Fork the repo and create your branch from `main`.
11+
2. Add tests for your code using [Common Test](https://erlang.org/doc/apps/common_test/basics_chapter.html).
12+
3. If you've changed APIs, update the documentation.
13+
4. Ensure the test suite passes by running `rebar3 ct`.
14+
5. Validate your code by running `rebar3 dialyzer xref`.
15+
6. Format your code automatically by running `rebar3 fmt`.
16+
6. If you haven't already, complete the Contributor License Agreement ("CLA").
17+
18+
## Contributor License Agreement ("CLA")
19+
In order to accept your pull request, we need you to submit a CLA. You only need
20+
to do this once to work on any of Meta's open source projects.
21+
22+
Complete your CLA here: <https://code.facebook.com/cla>
23+
24+
## Issues
25+
We use GitHub issues to track public bugs. Please ensure your description is
26+
clear and has sufficient instructions to be able to reproduce the issue.
27+
28+
Meta has a [bounty program](https://bugbounty.meta.com/) for the safe
29+
disclosure of security bugs. In those cases, please go through the process
30+
outlined on that page and do not file a public issue.
31+
32+
## Coding Style
33+
Run `rebar3 fmt` to auto-format your code.
34+
35+
## License
36+
By contributing to whatsapp/assert, you agree that your contributions will be
37+
licensed under the LICENSE file in the root directory of this source tree.

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
pull_request:
7+
branches:
8+
- main
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-22.04
15+
otp-version: 27
16+
rebar3-version: 3.24.0
17+
- os: macos-latest
18+
otp-version: 27
19+
rebar3-version: 3.24.0
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- uses: erlef/setup-beam@v1
25+
with:
26+
otp-version: ${{matrix.otp-version}}
27+
rebar3-version: ${{matrix.rebar3-version}}
28+
- name: Cache Hex packages
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.cache/rebar3/hex/hexpm/packages
32+
key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
33+
restore-keys: |
34+
${{ runner.os }}-hex-
35+
- name: Compile
36+
run: rebar3 compile
37+
- name: Test
38+
run: rebar3 ct
39+
- name: Format
40+
run: rebar3 fmt --check
41+
- name: XRef
42+
run: rebar3 xref
43+
- name: Cache Dialyzer PLTs
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/.cache/rebar3/rebar3_*.plt
47+
key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
48+
restore-keys: |
49+
${{ runner.os }}-dialyzer-
50+
- name: Dialyzer
51+
run: rebar3 dialyzer

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.rebar3
2+
_build
3+
_checkouts
4+
_vendor
5+
.eunit
6+
*.o
7+
*.beam
8+
*.plt
9+
*.swp
10+
*.swo
11+
.erlang.cookie
12+
ebin
13+
log
14+
erl_crash.dump
15+
.rebar
16+
logs
17+
.idea
18+
*.iml
19+
rebar3.crashdump
20+
*~
21+
.tool-versions

CODE_OF_CONDUCT.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make 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 within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
This Code of Conduct also applies outside the project spaces when there is a
56+
reasonable belief that an individual's behavior may have a negative impact on
57+
the project or its community.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported by contacting the project team at <opensource-conduct@meta.com>. All
63+
complaints will be reviewed and investigated and will result in a response that
64+
is deemed necessary and appropriate to the circumstances. The project team is
65+
obligated to maintain confidentiality with regard to the reporter of an incident.
66+
Further details of specific enforcement policies may be posted separately.
67+
68+
Project maintainers who do not follow or enforce the Code of Conduct in good
69+
faith may face temporary or permanent repercussions as determined by other
70+
members of the project's leadership.
71+
72+
## Attribution
73+
74+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
75+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
76+
77+
[homepage]: https://www.contributor-covenant.org
78+
79+
For answers to common questions about this code of conduct, see
80+
https://www.contributor-covenant.org/faq

LICENSE.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Apache License
2+
Version 2.0, January 2004
3+
4+
http://www.apache.org/licenses/
5+
6+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7+
8+
## 1. Definitions.
9+
10+
"License" shall mean the terms and conditions for use, reproduction, and
11+
distribution as defined by Sections 1 through 9 of this document.
12+
13+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
14+
owner that is granting the License.
15+
16+
"Legal Entity" shall mean the union of the acting entity and all other entities
17+
that control, are controlled by, or are under common control with that entity.
18+
For the purposes of this definition, "control" means (i) the power, direct or
19+
indirect, to cause the direction or management of such entity, whether by
20+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
21+
outstanding shares, or (iii) beneficial ownership of such entity.
22+
23+
"You" (or "Your") shall mean an individual or Legal Entity exercising
24+
permissions granted by this License.
25+
26+
"Source" form shall mean the preferred form for making modifications, including
27+
but not limited to software source code, documentation source, and configuration
28+
files.
29+
30+
"Object" form shall mean any form resulting from mechanical transformation or
31+
translation of a Source form, including but not limited to compiled object code,
32+
generated documentation, and conversions to other media types.
33+
34+
"Work" shall mean the work of authorship, whether in Source or Object form, made
35+
available under the License, as indicated by a copyright notice that is included
36+
in or attached to the work (an example is provided in the Appendix below).
37+
38+
"Derivative Works" shall mean any work, whether in Source or Object form, that
39+
is based on (or derived from) the Work and for which the editorial revisions,
40+
annotations, elaborations, or other modifications represent, as a whole, an
41+
original work of authorship. For the purposes of this License, Derivative Works
42+
shall not include works that remain separable from, or merely link (or bind by
43+
name) to the interfaces of, the Work and Derivative Works thereof.
44+
45+
"Contribution" shall mean any work of authorship, including the original version
46+
of the Work and any modifications or additions to that Work or Derivative Works
47+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
48+
by the copyright owner or by an individual or Legal Entity authorized to submit
49+
on behalf of the copyright owner. For the purposes of this definition,
50+
"submitted" means any form of electronic, verbal, or written communication sent
51+
to the Licensor or its representatives, including but not limited to
52+
communication on electronic mailing lists, source code control systems, and
53+
issue tracking systems that are managed by, or on behalf of, the Licensor for
54+
the purpose of discussing and improving the Work, but excluding communication
55+
that is conspicuously marked or otherwise designated in writing by the copyright
56+
owner as "Not a Contribution."
57+
58+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
59+
of whom a Contribution has been received by Licensor and subsequently
60+
incorporated within the Work.
61+
62+
## 2. Grant of Copyright License.
63+
64+
Subject to the terms and conditions of this License, each Contributor hereby
65+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
66+
irrevocable copyright license to reproduce, prepare Derivative Works of,
67+
publicly display, publicly perform, sublicense, and distribute the Work and such
68+
Derivative Works in Source or Object form.
69+
70+
## 3. Grant of Patent License.
71+
72+
Subject to the terms and conditions of this License, each Contributor hereby
73+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
74+
irrevocable (except as stated in this section) patent license to make, have
75+
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
76+
such license applies only to those patent claims licensable by such Contributor
77+
that are necessarily infringed by their Contribution(s) alone or by combination
78+
of their Contribution(s) with the Work to which such Contribution(s) was
79+
submitted. If You institute patent litigation against any entity (including a
80+
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
81+
Contribution incorporated within the Work constitutes direct or contributory
82+
patent infringement, then any patent licenses granted to You under this License
83+
for that Work shall terminate as of the date such litigation is filed.
84+
85+
## 4. Redistribution.
86+
87+
You may reproduce and distribute copies of the Work or Derivative Works thereof
88+
in any medium, with or without modifications, and in Source or Object form,
89+
provided that You meet the following conditions:
90+
91+
1. You must give any other recipients of the Work or Derivative Works a copy of
92+
this License; and
93+
94+
2. You must cause any modified files to carry prominent notices stating that
95+
You changed the files; and
96+
97+
3. You must retain, in the Source form of any Derivative Works that You
98+
distribute, all copyright, patent, trademark, and attribution notices from
99+
the Source form of the Work, excluding those notices that do not pertain to
100+
any part of the Derivative Works; and
101+
102+
4. If the Work includes a "NOTICE" text file as part of its distribution, then
103+
any Derivative Works that You distribute must include a readable copy of the
104+
attribution notices contained within such NOTICE file, excluding those
105+
notices that do not pertain to any part of the Derivative Works, in at least
106+
one of the following places: within a NOTICE text file distributed as part
107+
of the Derivative Works; within the Source form or documentation, if
108+
provided along with the Derivative Works; or, within a display generated by
109+
the Derivative Works, if and wherever such third-party notices normally
110+
appear. The contents of the NOTICE file are for informational purposes only
111+
and do not modify the License. You may add Your own attribution notices
112+
within Derivative Works that You distribute, alongside or as an addendum to
113+
the NOTICE text from the Work, provided that such additional attribution
114+
notices cannot be construed as modifying the License.
115+
116+
You may add Your own copyright statement to Your modifications and may provide
117+
additional or different license terms and conditions for use, reproduction, or
118+
distribution of Your modifications, or for any such Derivative Works as a whole,
119+
provided Your use, reproduction, and distribution of the Work otherwise complies
120+
with the conditions stated in this License.
121+
122+
## 5. Submission of Contributions.
123+
124+
Unless You explicitly state otherwise, any Contribution intentionally submitted
125+
for inclusion in the Work by You to the Licensor shall be under the terms and
126+
conditions of this License, without any additional terms or conditions.
127+
Notwithstanding the above, nothing herein shall supersede or modify the terms of
128+
any separate license agreement you may have executed with Licensor regarding
129+
such Contributions.
130+
131+
## 6. Trademarks.
132+
133+
This License does not grant permission to use the trade names, trademarks,
134+
service marks, or product names of the Licensor, except as required for
135+
reasonable and customary use in describing the origin of the Work and
136+
reproducing the content of the NOTICE file.
137+
138+
## 7. Disclaimer of Warranty.
139+
140+
Unless required by applicable law or agreed to in writing, Licensor provides the
141+
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
142+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
143+
including, without limitation, any warranties or conditions of TITLE, NON-
144+
INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
145+
solely responsible for determining the appropriateness of using or
146+
redistributing the Work and assume any risks associated with Your exercise of
147+
permissions under this License.
148+
149+
## 8. Limitation of Liability.
150+
151+
In no event and under no legal theory, whether in tort (including negligence),
152+
contract, or otherwise, unless required by applicable law (such as deliberate
153+
and grossly negligent acts) or agreed to in writing, shall any Contributor be
154+
liable to You for damages, including any direct, indirect, special, incidental,
155+
or consequential damages of any character arising as a result of this License or
156+
out of the use or inability to use the Work (including but not limited to
157+
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
158+
any and all other commercial damages or losses), even if such Contributor has
159+
been advised of the possibility of such damages.
160+
161+
## 9. Accepting Warranty or Additional Liability.
162+
163+
While redistributing the Work or Derivative Works thereof, You may choose to
164+
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
165+
other liability obligations and/or rights consistent with this License. However,
166+
in accepting such obligations, You may act only on Your own behalf and on Your
167+
sole responsibility, not on behalf of any other Contributor, and only if You
168+
agree to indemnify, defend, and hold each Contributor harmless for any liability
169+
incurred by, or claims asserted against, such Contributor by reason of your
170+
accepting any such warranty or additional liability.
171+
172+
END OF TERMS AND CONDITIONS
173+
174+
APPENDIX: How to apply the Apache License to your work.
175+
176+
To apply the Apache License to your work, attach the following
177+
boilerplate notice, with the fields enclosed by brackets "[]"
178+
replaced with your own identifying information. (Don't include
179+
the brackets!) The text should be enclosed in the appropriate
180+
comment syntax for the file format. We also recommend that a
181+
file or class name and description of purpose be included on the
182+
same "printed page" as the copyright notice for easier
183+
identification within third-party archives.
184+
185+
Copyright [yyyy] [name of copyright owner]
186+
187+
Licensed under the Apache License, Version 2.0 (the "License");
188+
you may not use this file except in compliance with the License.
189+
You may obtain a copy of the License at
190+
191+
http://www.apache.org/licenses/LICENSE-2.0
192+
193+
Unless required by applicable law or agreed to in writing, software
194+
distributed under the License is distributed on an "AS IS" BASIS,
195+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
196+
See the License for the specific language governing permissions and
197+
limitations under the License.

0 commit comments

Comments
 (0)