Skip to content

Commit 40ddaba

Browse files
docs(ai_policy): add an AI attribution policy to CONTRIBUTING.rst
Require AI generated contributions to indicate so in commit messages. Also add the CONTRIBUTING.rst file to the generated documentation.
1 parent a4cbecb commit 40ddaba

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

CONTRIBUTING.rst

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
############
12
Contributing
2-
============
3+
############
34

45
You can contribute to the project in multiple ways:
56

@@ -75,6 +76,9 @@ This creates a clearer project history, and automates our `Releases`_ and change
7576
* Bad: ``Update documentation for projects``
7677
* Good: ``docs(projects): update example for saving project attributes``
7778

79+
Also see the `AI attribution section <ai_attribution_section>`_ for information
80+
on attributing contributions from AI.
81+
7882
Coding Style
7983
------------
8084

@@ -90,6 +94,30 @@ To format your code according to our guidelines before committing, run:
9094
cd python-gitlab/
9195
tox -e black,isort
9296
97+
.. _ai_attribution_section:
98+
99+
AI Attribution
100+
--------------
101+
102+
When an AI coding assistant contributed meaningfully to a commit (writing or
103+
significantly modifying code, suggesting the fix, generating tests, etc.),
104+
add an ``Assisted-by`` trailer to the commit footer::
105+
106+
Assisted-by: <AgentName>:<ModelVersion>
107+
108+
Place it alongside any ``Closes:`` or ``BREAKING CHANGE:`` lines. Omit it when
109+
the AI contribution was trivial (e.g. a one-word suggestion or only
110+
autocomplete) or purely mechanical (running linters, reformatting).
111+
112+
Example::
113+
114+
fix(cli): correct the --spam flag
115+
116+
The --spam flag now says spam three times.
117+
118+
Closes: #1234
119+
Assisted-by: Claude:claude-sonnet-4-6
120+
93121
Running unit tests
94122
------------------
95123

docs/contributing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../CONTRIBUTING.rst

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
changelog
1717
release-notes
1818
faq
19+
contributing
1920

2021

2122
Indices and tables

0 commit comments

Comments
 (0)