Skip to content

Commit f7bcce5

Browse files
authored
docs(conduct): adopt the Contributor Covenant, with a stance on religious disagreement (#302)
A project inviting international contributors around a religious topic needs a stated behavioural baseline before it needs one (#284). Canonical Covenant text (GitHub's copy, not retyped), enforcement contact filled in, and one project-specific addition: disagreement about a ruling is expected and legitimate; disparaging a madhhab, a school, or a contributor's practice is not -- and the route for technical disagreement is a local attestation or the Compliance & classification category, never a person. tests/test_code_of_conduct.py pins the Covenant headings, the filled contact, and the stance.
1 parent fe61248 commit f7bcce5

2 files changed

Lines changed: 253 additions & 0 deletions

File tree

‎CODE_OF_CONDUCT.md‎

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
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, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
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
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
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.
45+
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.
50+
51+
## Scope
52+
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.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
eaitbrahim@gmail.com.
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
86+
of actions.
87+
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
93+
permanent 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
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.
129+
130+
131+
## A note on religious disagreement (project-specific addition)
132+
133+
This project exists at the intersection of code and Shariah compliance, and its contributors
134+
will disagree about rulings — what counts as riba exposure, whether a wrapper is permissible,
135+
how a token should be classified. **That disagreement is expected and legitimate.** It is not
136+
disloyalty, not trolling, and not a conduct problem.
137+
138+
What is NOT legitimate, and what this code of conduct will enforce exactly as it enforces any
139+
other harassment:
140+
141+
- **Disparaging a madhhab, a school of thought, a scholar, or a contributor's own practice.**
142+
"The Hanafi position on X is wrong" is an argument; "nobody serious follows that" is an
143+
attack. The first belongs in a discussion, the second belongs in an enforcement report.
144+
- **Presuming another contributor's level of religious observance**, or demanding they meet
145+
yours before their technical contribution counts.
146+
147+
The technical route for a disagreement about a classification is a **local attestation** —
148+
record your ruling, with your source, in your own deployment (`keel assets attest`; see
149+
`CONTRIBUTING.md`'s governance section) — or a post in the *Compliance & classification*
150+
category on Discussions. It is not an argument in a pull-request thread, and it is never a
151+
remark about the person who holds the other view.

‎tests/test_code_of_conduct.py‎

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
"""CODE_OF_CONDUCT.md: a behavioural baseline, before an international community arrives.
2+
3+
A project inviting international contributors around a religious topic needs a stated
4+
baseline before it needs anything else (#284): the moment disagreement about a ruling can
5+
read as disrespect about someone's practice, the project is one heated thread away from
6+
losing a contributor it will not get back.
7+
8+
Two failure shapes these tests guard:
9+
10+
- **A homemade conduct policy.** The Contributor Covenant is the sane default precisely
11+
because it is battle-tested language with known edge cases already litigated; a rewrite
12+
starts from zero and reads as whatever its author already believed. The canonical section
13+
headings are pinned so the file stays recognisably the Covenant.
14+
- **An unfilled template.** A `[INSERT CONTACT METHOD]` left in place gives an enforcement
15+
section that reaches nobody -- the same shape as an unfilled licence appendix, trusted
16+
and dead. The contact must be present and unfilled simultaneously impossible.
17+
18+
And one project-specific addition the Covenant cannot supply: a stance on religious
19+
disagreement itself, which here is expected and legitimate while disparagement is not --
20+
with the local-attestation route named as where technical disagreement belongs.
21+
"""
22+
23+
from __future__ import annotations
24+
25+
from pathlib import Path
26+
27+
_ROOT = Path(__file__).resolve().parents[1]
28+
29+
#: Section headings of the canonical Contributor Covenant; their presence is what makes the
30+
#: file the Covenant rather than a bespoke policy with the same filename.
31+
_COVENANT_MARKERS = (
32+
"# Contributor Covenant Code of Conduct",
33+
"## Our Pledge",
34+
"## Our Standards",
35+
"## Enforcement",
36+
"## Attribution",
37+
)
38+
39+
40+
def _coc() -> str:
41+
path = _ROOT / "CODE_OF_CONDUCT.md"
42+
assert path.is_file(), (
43+
"CODE_OF_CONDUCT.md does not exist at the repo root -- the project invites "
44+
"international contributors around a religious topic with no behavioural baseline (#284)"
45+
)
46+
return path.read_text()
47+
48+
49+
def test_the_file_is_the_contributor_covenant_not_a_homemade_policy():
50+
"""Every canonical section heading present: battle-tested text, not a first draft."""
51+
text = _coc()
52+
missing = [marker for marker in _COVENANT_MARKERS if marker not in text]
53+
assert not missing, (
54+
f"CODE_OF_CONDUCT.md is missing the Covenant's own section headings: {missing}. "
55+
"The point of adopting the Covenant is not to write one from scratch"
56+
)
57+
58+
59+
def test_no_placeholder_is_left_unfilled():
60+
"""An unfilled template is a conduct policy that reaches nobody.
61+
62+
GitHub's canonical text ships with `[INSERT CONTACT METHOD]`; leaving it in is the
63+
classic mistake, and it is invisible -- the section reads as configured while the
64+
enforcement channel is a blank.
65+
"""
66+
assert "[INSERT" not in _coc(), (
67+
"CODE_OF_CONDUCT.md still carries an unfilled placeholder -- fill in the contact "
68+
"method so the enforcement section reaches a human"
69+
)
70+
71+
72+
def test_an_enforcement_contact_that_reaches_someone_is_named():
73+
"""A concrete, reachable contact; 'the maintainers' is not an address."""
74+
import re
75+
76+
assert re.search(r"[\w.+-]+@[\w-]+\.[\w.]+", _coc()), (
77+
"CODE_OF_CONDUCT.md must name a concrete enforcement contact (an address, not a role)"
78+
)
79+
80+
81+
def test_religious_disagreement_has_a_stance():
82+
"""The project-specific addition: disagreement is legitimate, disparagement is not.
83+
84+
The Covenant's generic religion clause cannot carry this project's specific risk:
85+
contributors WILL disagree about rulings, and without a stated stance the only
86+
interpretations available are 'disagreement is disloyalty' or 'anything goes'. The
87+
boundary must be explicit -- a ruling may be argued about, a madhhab or a contributor's
88+
practice may not be disparaged -- and the technical route for the disagreement (a local
89+
attestation, not a thread) must be named so the stance routes people somewhere.
90+
"""
91+
text = _coc().lower()
92+
assert "madhhab" in text, (
93+
"the code of conduct must name the line: disparaging a madhhab or school is not "
94+
"acceptable behaviour"
95+
)
96+
assert "expected" in text and "legitimate" in text, (
97+
"disagreement about a religious ruling must be stated as expected and legitimate"
98+
)
99+
assert "attestation" in text, (
100+
"the stance must route technical disagreement to the local-attestation route, not "
101+
"leave it as an argument in a thread"
102+
)

0 commit comments

Comments
 (0)