# Code of Conduct

## Our Pledge

We pledge to make our community welcoming, safe, and equitable for all.

We are committed to fostering an environment that respects and promotes the dignity, rights,
and contributions of all individuals, regardless of characteristics including race, ethnicity,
caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender
identity or expression, sexual orientation, language, philosophy or religion, national or social
origin, socio-economic position, level of education, or other status. The same privileges of
participation are extended to everyone who participates in good faith and in accordance with
this Code of Conduct.


## Encouraged Behaviors

While acknowledging differences in social norms, we all strive to meet our community's
expectations for positive behavior. We also understand that our words and actions may be
interpreted differently than we intend based on culture, background, or native language.

With these considerations in mind, we agree to behave mindfully toward each other and act in
ways that center our shared values, including:

1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
2. Engaging **kindly and honestly** with others.
3. Respecting **different viewpoints** and experiences.
4. **Taking responsibility** for our actions and contributions.
5. Gracefully giving and accepting **constructive feedback**.
6. Committing to **repairing harm** when it occurs.
7. Behaving in other ways that promote and sustain the **well-being of our community**.


## Restricted Behaviors

We agree to restrict the following behaviors in our community. Instances, threats, and
promotion of these behaviors are violations of this Code of Conduct.

1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary
   personal attention after any clear request to stop.
2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a
   community member or group of people.
3. **Stereotyping or discrimination.** Characterizing anyone's personality or behavior on the
   basis of immutable identities or traits.
4. **Sexualization.** Behaving in a way that would generally be considered inappropriately
   intimate in the context or purpose of the community.
5. **Violating confidentiality.** Sharing or acting on someone's personal or private
   information without their permission.
6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any
   person or group.
7. Behaving in other ways that **threaten the well-being** of our community.

### Other Restrictions

1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be
   someone else to evade enforcement actions.
2. **Failing to credit sources.** Not properly crediting the sources of content you
   contribute.
3. **Promotional materials.** Sharing marketing or other commercial content in a way that is
   outside the norms of the community.
4. **Irresponsible communication.** Failing to responsibly present content which includes,
   links to, or describes any other restricted behavior.


## Reporting a Violation

Tensions can occur between community members even when they are trying their best to
collaborate. Not every conflict represents a Code of Conduct violation, and this Code of
Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize
harm.

When an incident does occur, it is important to report it promptly. Possible violations can be
reported in the following ways, in order of preference:

1. **GitHub's built-in reporting tools.** Use the *Report content* option available on issues,
   pull requests, comments, and user profiles directly on GitHub. This routes the report
   through GitHub's Trust & Safety process and is the most reliable channel.
2. **Contact a maintainer directly.** If you are unable or unwilling to use GitHub's reporting
   tools, reach out to a project maintainer via email or via direct message on Discord
   (find us in the [#cpal channel](https://discord.gg/vPmmSgJSPV)).

Maintainers take reports of violations seriously and will investigate all reports, reviewing
messages, logs, and recordings, or interviewing witnesses and other participants as needed.

The contents of a report and the identity of the reporter are kept confidential. Enforcement
actions, however, are public by default: they are posted in the relevant space so that the
community can see that a violation was addressed, what behavior was found to be unacceptable,
and what is expected going forward. Maintainers will use judgment to avoid unnecessarily
revealing the identity of a reporter, but the enforcement action itself will remain on the
public record.


## Enforcement

Enforcement actions are taken at the **sole discretion of the maintainers**, immediately and
without prior notice where the situation warrants it. Maintainer decisions are final.


### Typical Enforcement Actions

The measures below represent the most common tools available to maintainers and are listed
roughly in order of severity. Depending on the nature and seriousness of a violation, steps
may be skipped or combined.

1. **Public notice.**
   For a first or relatively minor violation, a maintainer may publicly state that specific
   behavior is not in line with this Code of Conduct and must stop, and specify the
   consequences of continued behavior without further warning. This is often the most
   proportionate first step in an open-source project where most interaction is inherently
   public.

2. **Content redaction.**
   Alongside or independent of a written notice, offending messages may have their content
   removed or minimized in part or entirely. This may be applied at any severity level when
   the content itself is the source of harm.

3. **Discussion lock.**
   An escalating or harmful discussion may be locked without prior notice. A written statement
   explaining the reason for the lock will accompany this action.

4. **Temporary suspension.**
   A repeated or more serious violation may result in temporary suspension of access to
   community spaces, tools, or communication channels, with conditions stated for return.

5. **Permanent ban.**
   A pattern of repeated violations that other measures have failed to resolve, or a violation
   so serious that no other remedy is adequate, may result in permanent removal from all
   community spaces.

### Notes on Enforcement

- Not every enforcement action needs to proceed through every step. Serious violations may
  result in an immediate suspension or ban.
- Enforcement actions are public by default. This maximises transparency, avoids any
  dependence on private messaging features, and makes clear to the whole community that
  violations are taken seriously and acted upon.
- The goal of enforcement is to protect the community and repair harm where possible, not to
  punish for its own sake.


## Scope

This Code of Conduct applies within all community spaces associated with the cpal project,
including the [cpal GitHub repository](https://github.com/RustAudio/cpal) under the
[RustAudio organization](https://github.com/RustAudio), the
[#cpal Discord channel](https://discord.gg/vPmmSgJSPV), and any other spaces where the
project is officially represented. It also applies when an individual is officially
representing the community in public spaces, for example when acting as an appointed
representative at an online or offline event.


## Attribution

This Code of Conduct is adapted from the
[Contributor Covenant, version 3.0](https://www.contributor-covenant.org/version/3/0/).

Contributor Covenant is stewarded by the
[Organization for Ethical Source](https://ethicalsource.dev/) and licensed under
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). For answers to common
questions, see the [FAQ](https://www.contributor-covenant.org/faq). Translations are available
at [contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
Additional enforcement and community guideline resources can be found at
[contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The
enforcement ladder in the original Covenant was inspired by the work of
[Mozilla's code of conduct team](https://github.com/mozilla/inclusion).
