cq-sdk 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cq_sdk-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yaml +84 -0
- cq_sdk-0.1.0/.github/ISSUE_TEMPLATE/config.yaml +5 -0
- cq_sdk-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yaml +54 -0
- cq_sdk-0.1.0/.github/ISSUE_TEMPLATE/task.yaml +37 -0
- cq_sdk-0.1.0/.github/dependabot.yml +15 -0
- cq_sdk-0.1.0/.github/pull_request_template.md +24 -0
- cq_sdk-0.1.0/.github/workflows/ci.yaml +52 -0
- cq_sdk-0.1.0/.github/workflows/release.yaml +37 -0
- cq_sdk-0.1.0/.gitignore +16 -0
- cq_sdk-0.1.0/.pre-commit-config.yaml +34 -0
- cq_sdk-0.1.0/.python-version +1 -0
- cq_sdk-0.1.0/CODE_OF_CONDUCT.md +76 -0
- cq_sdk-0.1.0/CONTRIBUTING.md +126 -0
- cq_sdk-0.1.0/LICENSE +190 -0
- cq_sdk-0.1.0/Makefile +78 -0
- cq_sdk-0.1.0/PKG-INFO +11 -0
- cq_sdk-0.1.0/README.md +84 -0
- cq_sdk-0.1.0/SECURITY.md +42 -0
- cq_sdk-0.1.0/pyproject.toml +51 -0
- cq_sdk-0.1.0/ruff.toml +69 -0
- cq_sdk-0.1.0/setup.cfg +4 -0
- cq_sdk-0.1.0/src/cq/__init__.py +38 -0
- cq_sdk-0.1.0/src/cq/client.py +315 -0
- cq_sdk-0.1.0/src/cq/cqpb/__init__.py +0 -0
- cq_sdk-0.1.0/src/cq/cqpb/api_pb2.py +66 -0
- cq_sdk-0.1.0/src/cq/cqpb/api_pb2.pyi +99 -0
- cq_sdk-0.1.0/src/cq/cqpb/knowledge_unit_pb2.py +50 -0
- cq_sdk-0.1.0/src/cq/cqpb/knowledge_unit_pb2.pyi +97 -0
- cq_sdk-0.1.0/src/cq/cqpb/review_pb2.py +59 -0
- cq_sdk-0.1.0/src/cq/cqpb/review_pb2.pyi +116 -0
- cq_sdk-0.1.0/src/cq/cqpb/scoring_pb2.py +39 -0
- cq_sdk-0.1.0/src/cq/cqpb/scoring_pb2.pyi +29 -0
- cq_sdk-0.1.0/src/cq/models.py +151 -0
- cq_sdk-0.1.0/src/cq/protocol/__init__.py +8 -0
- cq_sdk-0.1.0/src/cq/protocol/skill.md +213 -0
- cq_sdk-0.1.0/src/cq/py.typed +0 -0
- cq_sdk-0.1.0/src/cq/reflect.py +47 -0
- cq_sdk-0.1.0/src/cq/scoring.py +75 -0
- cq_sdk-0.1.0/src/cq/store.py +555 -0
- cq_sdk-0.1.0/src/cq_sdk.egg-info/PKG-INFO +11 -0
- cq_sdk-0.1.0/src/cq_sdk.egg-info/SOURCES.txt +67 -0
- cq_sdk-0.1.0/src/cq_sdk.egg-info/dependency_links.txt +1 -0
- cq_sdk-0.1.0/src/cq_sdk.egg-info/requires.txt +3 -0
- cq_sdk-0.1.0/src/cq_sdk.egg-info/top_level.txt +1 -0
- cq_sdk-0.1.0/tests/test_client.py +262 -0
- cq_sdk-0.1.0/tests/test_models.py +243 -0
- cq_sdk-0.1.0/tests/test_protocol.py +75 -0
- cq_sdk-0.1.0/tests/test_reflect.py +58 -0
- cq_sdk-0.1.0/tests/test_scoring.py +144 -0
- cq_sdk-0.1.0/tests/test_store.py +1183 -0
- cq_sdk-0.1.0/tests/testdata/README.md +26 -0
- cq_sdk-0.1.0/tests/testdata/go_flagged_unit.json +34 -0
- cq_sdk-0.1.0/tests/testdata/go_unit.json +30 -0
- cq_sdk-0.1.0/tests/testdata/ku_002.json +30 -0
- cq_sdk-0.1.0/tests/testdata/ku_003.json +34 -0
- cq_sdk-0.1.0/tests/testdata/ku_004.json +34 -0
- cq_sdk-0.1.0/tests/testdata/ku_005.json +30 -0
- cq_sdk-0.1.0/tests/testdata/ku_006.json +30 -0
- cq_sdk-0.1.0/tests/testdata/ku_007.json +29 -0
- cq_sdk-0.1.0/tests/testdata/ku_008.json +33 -0
- cq_sdk-0.1.0/tests/testdata/ku_009.json +30 -0
- cq_sdk-0.1.0/tests/testdata/ku_010.json +34 -0
- cq_sdk-0.1.0/tests/testdata/ku_011.json +30 -0
- cq_sdk-0.1.0/tests/testdata/ku_012.json +30 -0
- cq_sdk-0.1.0/tests/testdata/python_flagged_unit.json +34 -0
- cq_sdk-0.1.0/tests/testdata/python_real_unit.json +30 -0
- cq_sdk-0.1.0/tests/testdata/python_team_confirmed.json +30 -0
- cq_sdk-0.1.0/tests/testdata/python_unit.json +30 -0
- cq_sdk-0.1.0/uv.lock +664 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
description: Report a bug or an unexpected behavior
|
|
3
|
+
labels: ["bug", "needs-triage"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for taking the time to file a bug report!
|
|
9
|
+
Please read the [Contributing Guidelines](CONTRIBUTING.md) before submitting.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: description
|
|
12
|
+
attributes:
|
|
13
|
+
label: Description
|
|
14
|
+
description: A clear and concise description of what the bug is.
|
|
15
|
+
placeholder: Describe the bug here.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
id: reproduction-steps
|
|
20
|
+
attributes:
|
|
21
|
+
label: Steps to Reproduce
|
|
22
|
+
description: |
|
|
23
|
+
Provide clear steps to reproduce the behavior.
|
|
24
|
+
Please include code snippets, configurations, or detailed commands if relevant.
|
|
25
|
+
placeholder: |
|
|
26
|
+
1. Install cq-python '...'
|
|
27
|
+
2. Run code '....'
|
|
28
|
+
3. See error
|
|
29
|
+
validations:
|
|
30
|
+
required: true
|
|
31
|
+
- type: textarea
|
|
32
|
+
id: expected-behavior
|
|
33
|
+
attributes:
|
|
34
|
+
label: Expected Behavior
|
|
35
|
+
description: A clear and concise description of what you expected to happen.
|
|
36
|
+
placeholder: What did you expect to happen?
|
|
37
|
+
validations:
|
|
38
|
+
required: true
|
|
39
|
+
- type: textarea
|
|
40
|
+
id: actual-behavior
|
|
41
|
+
attributes:
|
|
42
|
+
label: Actual Behavior
|
|
43
|
+
description: A clear and concise description of what actually happened.
|
|
44
|
+
placeholder: What actually happened?
|
|
45
|
+
validations:
|
|
46
|
+
required: true
|
|
47
|
+
- type: textarea
|
|
48
|
+
id: environment
|
|
49
|
+
attributes:
|
|
50
|
+
label: Environment
|
|
51
|
+
description: Provide details about your environment.
|
|
52
|
+
value: |
|
|
53
|
+
- **OS:** [e.g. macOS, Windows, Linux] (and version)
|
|
54
|
+
- **Python Version:** [e.g. 3.12]
|
|
55
|
+
- **cq-python Version:** [e.g. 0.1.0]
|
|
56
|
+
- **Other relevant libraries/versions:**
|
|
57
|
+
render: markdown
|
|
58
|
+
validations:
|
|
59
|
+
required: false
|
|
60
|
+
- type: textarea
|
|
61
|
+
id: logs
|
|
62
|
+
attributes:
|
|
63
|
+
label: Relevant Log Output
|
|
64
|
+
description: |
|
|
65
|
+
If applicable, paste any relevant log and terminal output, error messages, or screenshots.
|
|
66
|
+
Please wrap code blocks in triple backticks (```).
|
|
67
|
+
render: shell
|
|
68
|
+
validations:
|
|
69
|
+
required: false
|
|
70
|
+
- type: checkboxes
|
|
71
|
+
id: self-checklist
|
|
72
|
+
attributes:
|
|
73
|
+
label: Self-Checklist
|
|
74
|
+
options:
|
|
75
|
+
- label: I have read the [Contributing Guidelines](CONTRIBUTING.md).
|
|
76
|
+
required: true
|
|
77
|
+
- label: I have searched the existing issues and found no duplicate.
|
|
78
|
+
required: true
|
|
79
|
+
- label: I have provided a clear and concise description of the bug.
|
|
80
|
+
required: true
|
|
81
|
+
- label: I have provided clear steps to reproduce the bug.
|
|
82
|
+
required: true
|
|
83
|
+
- label: I have provided details about my environment.
|
|
84
|
+
required: true
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
description: Suggest an idea or enhancement for the project.
|
|
3
|
+
labels: ["enhancement", "needs-triage"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Thanks for suggesting an idea!
|
|
9
|
+
Please read the [Contributing Guidelines](CONTRIBUTING.md) before submitting.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: problem-description
|
|
12
|
+
attributes:
|
|
13
|
+
label: Is your feature request related to a problem? Please describe.
|
|
14
|
+
description: A clear and concise description of the problem you're trying to solve. e.g. "I'm always frustrated when [...]"
|
|
15
|
+
placeholder: Describe the problem.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
id: solution-description
|
|
20
|
+
attributes:
|
|
21
|
+
label: Describe the solution you'd like
|
|
22
|
+
description: A clear and concise description of what you want to happen.
|
|
23
|
+
placeholder: Describe the solution.
|
|
24
|
+
validations:
|
|
25
|
+
required: true
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: alternatives
|
|
28
|
+
attributes:
|
|
29
|
+
label: Describe alternatives you've considered
|
|
30
|
+
description: A clear and concise description of any alternative solutions or features you've considered.
|
|
31
|
+
placeholder: Describe alternatives.
|
|
32
|
+
validations:
|
|
33
|
+
required: false
|
|
34
|
+
- type: textarea
|
|
35
|
+
id: additional-context
|
|
36
|
+
attributes:
|
|
37
|
+
label: Additional Context
|
|
38
|
+
description: Add any other context or screenshots about the feature request here.
|
|
39
|
+
placeholder: Any additional information.
|
|
40
|
+
validations:
|
|
41
|
+
required: false
|
|
42
|
+
- type: checkboxes
|
|
43
|
+
id: self-checklist
|
|
44
|
+
attributes:
|
|
45
|
+
label: Self-Checklist
|
|
46
|
+
options:
|
|
47
|
+
- label: I have read the [Contributing Guidelines](CONTRIBUTING.md).
|
|
48
|
+
required: true
|
|
49
|
+
- label: I have searched the existing issues and found no duplicate.
|
|
50
|
+
required: true
|
|
51
|
+
- label: I have provided a clear and concise description of the problem.
|
|
52
|
+
required: true
|
|
53
|
+
- label: I have provided a clear and concise description of the proposed solution.
|
|
54
|
+
required: true
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Task
|
|
2
|
+
description: Create a simple task or to-do item
|
|
3
|
+
labels: ["needs-triage"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Use this template for simple tasks, improvements, or to-do items that don't fit the bug report or feature request categories.
|
|
9
|
+
Please read the [Contributing Guidelines](CONTRIBUTING.md) before submitting.
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: description
|
|
12
|
+
attributes:
|
|
13
|
+
label: Description
|
|
14
|
+
description: A clear and concise description of the task.
|
|
15
|
+
placeholder: What needs to be done?
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
id: additional
|
|
20
|
+
attributes:
|
|
21
|
+
label: Additional Context
|
|
22
|
+
description: Add any other context, references, or details about the task.
|
|
23
|
+
validations:
|
|
24
|
+
required: false
|
|
25
|
+
- type: checkboxes
|
|
26
|
+
id: self-checklist
|
|
27
|
+
attributes:
|
|
28
|
+
label: Self-Checklist
|
|
29
|
+
options:
|
|
30
|
+
- label: I have read the [Contributing Guidelines](CONTRIBUTING.md).
|
|
31
|
+
required: true
|
|
32
|
+
- label: I have searched the existing issues and found no duplicate.
|
|
33
|
+
required: true
|
|
34
|
+
- label: I have provided a clear and concise description of the task.
|
|
35
|
+
required: true
|
|
36
|
+
- label: I have provided a clear and concise description of the proposed solution.
|
|
37
|
+
required: true
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- directory: "/"
|
|
4
|
+
package-ecosystem: "pip"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "monthly"
|
|
7
|
+
labels:
|
|
8
|
+
- "maintenance"
|
|
9
|
+
|
|
10
|
+
- directory: "/"
|
|
11
|
+
package-ecosystem: "github-actions"
|
|
12
|
+
schedule:
|
|
13
|
+
interval: "monthly"
|
|
14
|
+
labels:
|
|
15
|
+
- "maintenance"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
<!-- What does this PR do? -->
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## PR Type
|
|
6
|
+
<!-- Delete the types that don't apply -->
|
|
7
|
+
|
|
8
|
+
- New Feature
|
|
9
|
+
- Bug Fix
|
|
10
|
+
- Refactor
|
|
11
|
+
- Documentation
|
|
12
|
+
- Infrastructure
|
|
13
|
+
|
|
14
|
+
## Relevant issues
|
|
15
|
+
<!-- e.g. "Fixes #123" -->
|
|
16
|
+
|
|
17
|
+
## Checklist
|
|
18
|
+
<!-- If this checklist is deleted from the PR submission it will be immediately closed -->
|
|
19
|
+
- [ ] I understand the code I am submitting.
|
|
20
|
+
- [ ] I have added unit tests that prove my fix/feature works
|
|
21
|
+
- [ ] I have run this code locally and verified it fixes the issue.
|
|
22
|
+
- [ ] New and existing tests pass locally
|
|
23
|
+
- [ ] Documentation was updated where necessary
|
|
24
|
+
- [ ] I have read and followed the [contribution guidelines](https://github.com/mozilla-ai/cq-python/blob/main/CONTRIBUTING.md)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
name: Lint
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v6.0.2
|
|
18
|
+
|
|
19
|
+
- uses: astral-sh/setup-uv@v7
|
|
20
|
+
with:
|
|
21
|
+
enable-cache: true
|
|
22
|
+
|
|
23
|
+
- name: Fetch skill prompt
|
|
24
|
+
run: make fetch-skill
|
|
25
|
+
|
|
26
|
+
- name: Check required artifacts
|
|
27
|
+
run: test -f src/cq/protocol/skill.md || { echo "Missing skill.md — run make fetch-skill"; exit 1; }
|
|
28
|
+
|
|
29
|
+
- name: Lint
|
|
30
|
+
run: |
|
|
31
|
+
uv sync --group dev
|
|
32
|
+
make lint
|
|
33
|
+
|
|
34
|
+
test:
|
|
35
|
+
name: Test
|
|
36
|
+
needs: [lint]
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
strategy:
|
|
39
|
+
matrix:
|
|
40
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v6.0.2
|
|
43
|
+
|
|
44
|
+
- uses: astral-sh/setup-uv@v7
|
|
45
|
+
with:
|
|
46
|
+
enable-cache: true
|
|
47
|
+
python-version: ${{ matrix.python-version }}
|
|
48
|
+
|
|
49
|
+
- name: Test
|
|
50
|
+
run: |
|
|
51
|
+
uv sync --group dev
|
|
52
|
+
make test
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
environment: pypi
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
id-token: write
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout
|
|
20
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Setup Python
|
|
25
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
26
|
+
with:
|
|
27
|
+
python-version: '3.11'
|
|
28
|
+
|
|
29
|
+
- name: Install build tools
|
|
30
|
+
run: pip install --upgrade pip build
|
|
31
|
+
|
|
32
|
+
- name: Build package
|
|
33
|
+
run: python -m build
|
|
34
|
+
|
|
35
|
+
- name: Upload to PyPI
|
|
36
|
+
if: github.event_name == 'release'
|
|
37
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
cq_sdk-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-added-large-files
|
|
6
|
+
- id: check-case-conflict
|
|
7
|
+
- id: check-merge-conflict
|
|
8
|
+
- id: check-toml
|
|
9
|
+
- id: check-yaml
|
|
10
|
+
- id: end-of-file-fixer
|
|
11
|
+
- id: mixed-line-ending
|
|
12
|
+
args:
|
|
13
|
+
- "--fix=lf"
|
|
14
|
+
- id: trailing-whitespace
|
|
15
|
+
|
|
16
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
17
|
+
rev: v0.15.8
|
|
18
|
+
hooks:
|
|
19
|
+
- id: ruff
|
|
20
|
+
args:
|
|
21
|
+
- "--fix"
|
|
22
|
+
- "--exit-non-zero-on-fix"
|
|
23
|
+
- id: ruff-format
|
|
24
|
+
|
|
25
|
+
- repo: https://github.com/Yelp/detect-secrets
|
|
26
|
+
rev: v1.5.0
|
|
27
|
+
hooks:
|
|
28
|
+
- id: detect-secrets
|
|
29
|
+
exclude: uv\.lock$
|
|
30
|
+
|
|
31
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
32
|
+
rev: 0.10.7
|
|
33
|
+
hooks:
|
|
34
|
+
- id: uv-lock
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Contributor Covenant 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 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 team at mozilla.ai. 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
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Contributing to cq
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to cq. This guide explains how to get involved.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## **Guidelines for Contributions**
|
|
8
|
+
|
|
9
|
+
### Ground Rules
|
|
10
|
+
|
|
11
|
+
- Review issue discussion fully before starting work. Engage in the thread first when an issue is under discussion.
|
|
12
|
+
- PRs must build on agreed direction where ones exist. If there is no agreed direction, seek consensus from the core maintainers.
|
|
13
|
+
- PRs with "drive-by" unrelated changes or untested refactors will be closed.
|
|
14
|
+
- Untested or failing code is not eligible for review.
|
|
15
|
+
- PR description **must** follow the PR template and explain **what** changed, **why**, and **how to test**.
|
|
16
|
+
- Links to related issues are required.
|
|
17
|
+
- Duplicate PRs will be automatically closed.
|
|
18
|
+
- Only have 1-2 PRs open at a time. Any further PRs will be closed.
|
|
19
|
+
|
|
20
|
+
**Maintainers reserve the right to close issues and PRs that do not align with the library roadmap.**
|
|
21
|
+
|
|
22
|
+
### Code Clarity and Style
|
|
23
|
+
|
|
24
|
+
- **Readability first:** Code must be self-documenting—if it is not self-explanatory, it should include clear, concise comments where logic is non-obvious.
|
|
25
|
+
- **Consistent Style:** Follow existing codebase style (e.g., function naming, Go conventions)
|
|
26
|
+
- **No dead/debug code:** Remove commented-out blocks, leftover debug statements, unrelated refactors
|
|
27
|
+
- Failure modes must be documented and handled with robust error handling.
|
|
28
|
+
|
|
29
|
+
### Testing Requirements
|
|
30
|
+
|
|
31
|
+
- **Coverage:** All new functionality must include unit tests covering both happy paths and relevant edge cases.
|
|
32
|
+
- **Passing tests:** All linting and formatting checks must pass (see below on how to run).
|
|
33
|
+
- **No silent failures:** Tests should fail loudly on errors. No placeholder tests.
|
|
34
|
+
|
|
35
|
+
### Scope and Size
|
|
36
|
+
|
|
37
|
+
- **One purpose per PR:** No kitchen-sink PRs mixing bugfixes, refactors, and features.
|
|
38
|
+
- **Small, reviewable chunks:** If your PR is too large to review in under 30 minutes, break it up into chunks.
|
|
39
|
+
- Each chunk must be independently testable and reviewable
|
|
40
|
+
- If you can't explain why it can't be split, expect an automatic request for refactoring.
|
|
41
|
+
- Pull requests that are **large** (>500 LOC changed) or span multiple subsystems will be closed with automatic requests for refactoring.
|
|
42
|
+
- If the PR is to implement a new feature, please first make a GitHub issue to suggest the feature and allow for discussion. We reserve the right to close feature implementations and request discussion via an issue.
|
|
43
|
+
|
|
44
|
+
## How to Contribute
|
|
45
|
+
|
|
46
|
+
### **Browse Existing Issues** 🔍
|
|
47
|
+
- Check the Issues page to see if there are any tasks you'd like to tackle.
|
|
48
|
+
- Look for issues labeled **`good first issue`** if you're new to the project—they're a great place to start.
|
|
49
|
+
|
|
50
|
+
### **Report Issues** 🐛
|
|
51
|
+
- **Bugs:** Please use our [Bug Report template](.github/ISSUE_TEMPLATE/bug_report.yaml) to provide clear steps to reproduce and environment details.
|
|
52
|
+
- **Search First:** Before creating a new issue, please search existing issues to see if your topic has already been discussed.
|
|
53
|
+
- Provide as much detail as possible, including the steps to reproduce the issue and expected vs. actual behavior.
|
|
54
|
+
|
|
55
|
+
### **Suggest Features** 🚀
|
|
56
|
+
- **Features:** Please use our [Feature Request template](.github/ISSUE_TEMPLATE/feature_request.yaml) to describe the problem your idea solves and your proposed solution.
|
|
57
|
+
- Share why the feature is important and any alternative solutions you've considered.
|
|
58
|
+
- If the PR is to implement a new feature, please first make a GitHub issue to suggest the feature and allow for discussion.
|
|
59
|
+
|
|
60
|
+
## Before You Start
|
|
61
|
+
|
|
62
|
+
- **Search for duplicates.** Check [existing issues](https://github.com/mozilla-ai/cq-python/issues) and [open pull requests](https://github.com/mozilla-ai/cq-python/pulls) before starting work.
|
|
63
|
+
- **Discuss major changes first.** Open an issue before starting work on: new features, API changes, architectural changes, breaking changes, or new dependencies. This avoids wasted effort and helps maintainers provide early guidance.
|
|
64
|
+
- **Set up your development environment.** See the [README](README.md) for prerequisites, installation, and how to run tests and linters.
|
|
65
|
+
|
|
66
|
+
## Making Changes
|
|
67
|
+
|
|
68
|
+
### Branch Naming
|
|
69
|
+
|
|
70
|
+
Use descriptive branch names with one of these prefixes:
|
|
71
|
+
|
|
72
|
+
| Prefix | Use case |
|
|
73
|
+
|-------------|-----------------------|
|
|
74
|
+
| `feature/` | New features |
|
|
75
|
+
| `fix/` | Bug fixes |
|
|
76
|
+
| `refactor/` | Code improvements |
|
|
77
|
+
| `docs/` | Documentation changes |
|
|
78
|
+
| `chore/` | Maintenance tasks |
|
|
79
|
+
|
|
80
|
+
### Tests and Commits
|
|
81
|
+
|
|
82
|
+
- Write tests for every change. Bug fixes should include a test that reproduces the issue.
|
|
83
|
+
- Write clear commit messages that explain *why* the change was made, not just *what* changed.
|
|
84
|
+
- Keep commits atomic; each commit should represent one logical change.
|
|
85
|
+
|
|
86
|
+
## Submitting Your Contribution
|
|
87
|
+
|
|
88
|
+
1. Fork the repository and clone your fork.
|
|
89
|
+
2. Add the upstream remote: `git remote add upstream https://github.com/mozilla-ai/cq-python.git`
|
|
90
|
+
3. Create a branch from `main` following the naming conventions above.
|
|
91
|
+
4. Make your changes, including tests.
|
|
92
|
+
5. Push your branch to your fork and open a pull request against `main`.
|
|
93
|
+
|
|
94
|
+
Your PR description should include:
|
|
95
|
+
|
|
96
|
+
- What changed and why.
|
|
97
|
+
- How to test the change.
|
|
98
|
+
- Links to related issues (use `Fixes #123` or `Closes #456` to auto-close them).
|
|
99
|
+
|
|
100
|
+
## Review Process
|
|
101
|
+
|
|
102
|
+
- Expect an initial response within 5 business days.
|
|
103
|
+
- Simple fixes typically take around 1 week to merge; complex features may take 2-3 weeks.
|
|
104
|
+
- Address review comments with new commits rather than force-pushing during review. This makes it easier for reviewers to see incremental changes.
|
|
105
|
+
- Pull requests with no activity for 30 or more days may be closed. You are welcome to reopen or re-submit if you return to the work.
|
|
106
|
+
|
|
107
|
+
## Your First Contribution
|
|
108
|
+
|
|
109
|
+
- Look for issues labeled [`good-first-issue`](https://github.com/mozilla-ai/cq-python/labels/good-first-issue) or [`help-wanted`](https://github.com/mozilla-ai/cq-python/labels/help-wanted).
|
|
110
|
+
- Comment on the issue to claim it so others know you are working on it.
|
|
111
|
+
- Ask questions early; maintainers are happy to help.
|
|
112
|
+
- Start small. A well-scoped first PR is easier to review and merge.
|
|
113
|
+
|
|
114
|
+
## Code of Conduct
|
|
115
|
+
|
|
116
|
+
This project follows Mozilla's [Community Participation Guidelines](https://www.mozilla.org/about/governance/policies/participation/).
|
|
117
|
+
|
|
118
|
+
See our full [Code of Conduct](CODE_OF_CONDUCT.md) for details.
|
|
119
|
+
|
|
120
|
+
## Security
|
|
121
|
+
|
|
122
|
+
If you discover a security vulnerability, do **not** open a public issue. See [SECURITY.md](SECURITY.md) for responsible disclosure instructions.
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
By contributing code to this project, you agree that your contributions will be licensed under the [Apache License 2.0](LICENSE), the same license that covers the project.
|